-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
allow current user to reset their own password #5034
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #5034 +/- ##
=========================================
Coverage ? 40.47%
=========================================
Files ? 405
Lines ? 54399
Branches ? 0
=========================================
Hits ? 22017
Misses ? 29356
Partials ? 3026
Continue to review full report at Codecov.
|
@@ -1179,6 +1185,10 @@ func ResetPasswdPost(ctx *context.Context) { | |||
ctx.ServerError("UpdateUser", err) | |||
return | |||
} | |||
|
|||
// Just in case the user is signed in to another account | |||
handleSignOut(ctx) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer that there would be check for code that was issued for what user and currently authorised user and if they do not much than return error (probably 404?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be another PR.
The 404 that's already there is really confusing. I think there should be some sort of error message to the user like "This code is not valid or has expired." to let them know that Gitea doesn't have a bug, it recognized what they were trying to do, but followed a set of rules to disallow the action they intended, and gives them a clue as to what to do next to accomplish their goal. Although the type of user we have is probably pretty savvy, giving feedback so will also increase security by reducing chances for social engineering attacks or pranks. |
I've got a second PR on the way that contains the ux fixes, showing the correct error message in each of the edge cases discussed in this issue as well as the original issue. It's currently visible in use at https://git.coolaj86.com, but I have to fix a conflict between my v1.5.1 backports and master, and I have to head out for a bit, so I may not push it until tonight. |
Can these changes be merged into #5042 ? |
@lafriks I'm still a bit under water right now, but I'll try to make some time to merge them together. Thanks for reviewing. :) |
d3a4d76
to
0d701e4
Compare
Rebased and ready for re-review! |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 months. Thank you for your contributions. |
Please resolve the conflicts |
It looks like #5042 supersedes this. What's the envisioned behaviour for this. |
Looking at the commit history, I believe that is correct. These changes were included in and improved upon by #5042 |
1 similar comment
Looking at the commit history, I believe that is correct. These changes were included in and improved upon by #5042 |
Thanks @solderjs for your contributions. Sorry some of them have languished. |
Re: #5008
The current logged-in user (which may have signed in via OAuth) is not able to reset their own password via email reset, because they cannot access the form.
Beyond fixing the bug, these are some things I'd be open to adding now (but would prefer to wait until after this clears)