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

Closed
opened 2025-11-02 07:42:43 -06:00 by GiteaMirror · 6 comments
Owner

Originally created by @Floaf on GitHub (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).

Originally created by @Floaf on GitHub (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).
GiteaMirror added the issue/needs-feedback label 2025-11-02 07:42:43 -06:00
Author
Owner

@zeripath commented on GitHub (Oct 10, 2021):

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 commented on GitHub (Oct 10, 2021): 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.
Author
Owner

@Floaf commented on GitHub (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 commented on GitHub (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.
Author
Owner

@Floaf commented on GitHub (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 :-)

@Floaf commented on GitHub (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 :-)
Author
Owner

@wxiaoguang commented on GitHub (Oct 24, 2021):

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.

@wxiaoguang commented on GitHub (Oct 24, 2021): 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.
Author
Owner

@Floaf commented on GitHub (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.

@Floaf commented on GitHub (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.
Author
Owner

@wxiaoguang commented on GitHub (Apr 8, 2022):

The CSRF token problem should have been resolved by #19337

The draft problem has an issue: https://github.com/go-gitea/gitea/issues/1315

@wxiaoguang commented on GitHub (Apr 8, 2022): The CSRF token problem should have been resolved by #19337 The draft problem has an issue: https://github.com/go-gitea/gitea/issues/1315
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#7960