Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show login form and redo action if successful login when trying to comment on an issue where session has timed out. #17282

Closed
Floaf opened this issue Oct 10, 2021 · 6 comments
Labels
issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail

Comments

@Floaf
Copy link

Floaf commented Oct 10, 2021

Feature Description

I am having a few issues open in tabs in gitea that I am working on and i write comments to them from time to time. Sometimes it has been a few days in between and the session has expired.
As of now, there is no way of knowing that (that might be a feature request on it's own) so when i write a comment and press "Comment", I am redirected to the startpage and that's it. It is not so user friendly.

I have to login in and then i have to go to my issue again and then write the comment again.

My suggestion is that when you are trying to do an action when session has expired, show the login form and if the user enter the correct credentials, try to redo the action the user was trying to do, like in my case, try to post in the comment again. Then there is no loss of data (and time).

@zeripath
Copy link
Contributor

What version of gitea? This should be fixed by #14937 which is 1.15 and #16378 which is 1.14.6.


In future please complete the issue proforma properly.

@zeripath zeripath added the issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail label Oct 10, 2021
@Floaf
Copy link
Author

Floaf commented Oct 11, 2021

Yes, I am sorry I did not complete the issue form and you are right, I did not have the latest version. But now I just upgraded to version 1.15.4 and i see that I am redirected to the root page if this happens. It is a little bit better but the main problem still exists. All the data that is entered when trying to submit in an expired session is still lost.
My suggestion is not to have a redirect, but to show a login form and on that page capture the submitted post data from the original submit (in hidden form fields?) so if you login again, the original request is performed again and no data is lost.

@Floaf Floaf changed the title Show login form instead of "Invalid csrf token." and redo action if successful login Show login form and redo action if successful login when trying to comment on an issue where session has timed out. Oct 24, 2021
@Floaf
Copy link
Author

Floaf commented Oct 24, 2021

And there it happened again, I lost a loong comment because I just get thrown to the startpage with no way of recovering the message and post it again. I don't know if I am the only one working this way but getting "thrown out" with no warning and losing data is frustrating.
I will rename the title though so it more clearly describe the issue since the main issue is still there :-)

@wxiaoguang
Copy link
Contributor

I think a better approach can be saving the content draft into local storage. Then there can be a button to restore content from local storage.

@Floaf
Copy link
Author

Floaf commented Oct 24, 2021

I just increased session lifetime:
SESSION_LIFE_TIME = 864000000

I don't know if this will help but if it does, at least the issue won't happen a few times every week.

@wxiaoguang
Copy link
Contributor

The CSRF token problem should have been resolved by #19337

The draft problem has an issue: #1315

@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail
Projects
None yet
Development

No branches or pull requests

3 participants