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

Merge to master: Release 2.5.2 - Fix: explicitly load resetTokenExpireTime in password reset #110

Merged
merged 1 commit into from
Nov 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions helpers/users_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,10 @@ def token(len)
end

def reset_password(email, username, token)
user = LinkedData::Models::User.where(email: email, username: username).include(User.goo_attrs_to_load(includes_param)).first
user = LinkedData::Models::User.where(email: email, username: username).include(User.goo_attrs_to_load(includes_param) + [:resetToken, :passwordHash, :resetTokenExpireTime]).first

error 404, "User not found" unless user

user.bring(:resetToken)
user.bring(:passwordHash)
user.show_apikey = true
token_accepted = token.eql?(user.resetToken)
if token_accepted
Expand Down
Loading