Add info flash translation for used recovery key
This commit is contained in:
parent
04d650a85a
commit
9899f05560
|
@ -21,7 +21,7 @@ class User::SessionsController < Devise::SessionsController
|
||||||
if params[:user][:otp_attempt].length == 8
|
if params[:user][:otp_attempt].length == 8
|
||||||
found = TotpRecoveryCode.where(user_id: resource.id, code: params[:user][:otp_attempt].downcase).delete_all
|
found = TotpRecoveryCode.where(user_id: resource.id, code: params[:user][:otp_attempt].downcase).delete_all
|
||||||
if found == 1
|
if found == 1
|
||||||
flash[:info] = "You have #{TotpRecoveryCode.where(user_id: resource.id).count} recovery codes remaining."
|
flash[:info] = t(".info", count: TotpRecoveryCode.where(user_id: resource.id).count)
|
||||||
continue_sign_in(resource, resource_name)
|
continue_sign_in(resource, resource_name)
|
||||||
else
|
else
|
||||||
flash[:error] = t(".error")
|
flash[:error] = t(".error")
|
||||||
|
|
|
@ -45,4 +45,5 @@ en:
|
||||||
error: "Theme saving failed. %{errors}"
|
error: "Theme saving failed. %{errors}"
|
||||||
sessions:
|
sessions:
|
||||||
create:
|
create:
|
||||||
|
info: "You have %{count} recovery codes remaining."
|
||||||
error: :errors.invalid_otp
|
error: :errors.invalid_otp
|
||||||
|
|
Loading…
Reference in New Issue