mirror of
https://github.com/we-promise/sure.git
synced 2026-05-11 22:55:00 +00:00
fix(auth): hash MFA backup codes (#1629)
* fix(auth): hash MFA backup codes * fix(auth): lock and filter backup code verification * test(auth): assert consumed backup code digest * fix(auth): strengthen backup code handling * fix(auth): require otp secret before mfa enable * test(auth): assert backup code digest consumption * fix(auth): rehash legacy MFA backup codes * fix(auth): narrow legacy backup code migration
This commit is contained in:
@@ -11,8 +11,7 @@ class MfaController < ApplicationController
|
||||
|
||||
def create
|
||||
if Current.user.verify_otp?(params[:code])
|
||||
Current.user.enable_mfa!
|
||||
@backup_codes = Current.user.otp_backup_codes
|
||||
@backup_codes = Current.user.enable_mfa!
|
||||
render :backup_codes
|
||||
else
|
||||
Current.user.disable_mfa!
|
||||
|
||||
Reference in New Issue
Block a user