Add `after_session_confirm` hook after session confirmation
Just a suggestion to add a after_session_confirm similar to after_session_save. This would let folks mark accounts as "verified" or "has_verified_email" after session confirmation.
Good idea!
This would be a great feature. I'm marking the "email_verified" field if current_user is present. I have added this check in ApplicationController, which is not ideal as it checks on every single request.
I looked around the code to see if I can contribute in any way but not sure what would be the best way to add this. May be somewhere in authenticate_and_sign_in?
I submitted a PR #237 that solves this issue and adds a configuration key to setup the hook like:
Passwordless.configure do |config|
config.after_session_confirm = ->(session) {
user = session.authenticatable
user.update(email_verified: true)
}
end
@mikker @onerinas @onedanshow @Ardnived
Responded in PR. Thank you for contributing @wilburhimself !