Chore: Improve confirmation flow for agents (#3519)

- Agents are redirected to the password reset page which confirms the agent as well as sets a new password.
This commit is contained in:
Sojan Jose
2021-12-09 11:11:46 +05:30
committed by GitHub
parent 9306b725d8
commit 1db82f235d
3 changed files with 23 additions and 7 deletions

View File

@@ -28,10 +28,7 @@ class DeviseOverrides::ConfirmationsController < Devise::ConfirmationsController
end
def create_reset_token_link(user)
raw, enc = Devise.token_generator.generate(user.class, :reset_password_token)
user.reset_password_token = enc
user.reset_password_sent_at = Time.now.utc
user.save(validate: false)
"/app/auth/password/edit?config=default&redirect_url=&reset_password_token=#{raw}"
token = user.send(:set_reset_password_token)
"/app/auth/password/edit?config=default&redirect_url=&reset_password_token=#{token}"
end
end