Skip to content

Commit

Permalink
Merge pull request #110 from ontoportal-lirmm/development
Browse files Browse the repository at this point in the history
Merge to master: Release 2.5.2 - Fix: explicitly load resetTokenExpireTime in password reset
  • Loading branch information
imadbourouche authored Nov 28, 2024
2 parents 0eae7ed + 709849d commit fb89c6c
Showing 1 changed file with 1 addition and 3 deletions.
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

0 comments on commit fb89c6c

Please sign in to comment.