Patch #36005 » 36005.patch
| lib/redmine/twofa/base.rb | ||
|---|---|---|
|
end
|
||
|
def deliver_twofa_paired
|
||
|
::Mailer.security_notification(
|
||
|
::Mailer.deliver_security_notification(
|
||
|
@user,
|
||
|
User.current,
|
||
|
{
|
||
| ... | ... | |
|
field: "twofa__#{scheme_name}__name",
|
||
|
url: {controller: 'my', action: 'account'}
|
||
|
}
|
||
|
).deliver
|
||
|
)
|
||
|
end
|
||
|
def destroy_pairing!(code)
|
||
| ... | ... | |
|
end
|
||
|
def deliver_twofa_unpaired
|
||
|
::Mailer.security_notification(
|
||
|
::Mailer.deliver_security_notification(
|
||
|
@user,
|
||
|
User.current,
|
||
|
{
|
||
| ... | ... | |
|
message: 'twofa_mail_body_security_notification_unpaired',
|
||
|
url: {controller: 'my', action: 'account'}
|
||
|
}
|
||
|
).deliver
|
||
|
)
|
||
|
end
|
||
|
def send_code(controller: nil, action: nil)
|
||
| ... | ... | |
|
# make sure the user using the backup code is the same it's been issued to
|
||
|
return false unless @user.present? && @user == user_from_code
|
||
|
::Mailer.security_notification(
|
||
|
::Mailer.deliver_security_notification(
|
||
|
@user,
|
||
|
User.current,
|
||
|
{
|
||
| ... | ... | |
|
message: 'twofa_mail_body_backup_code_used',
|
||
|
url: {controller: 'my', action: 'account'}
|
||
|
}
|
||
|
).deliver
|
||
|
)
|
||
|
return true
|
||
|
end
|
||
| ... | ... | |
|
token.update_columns value: Redmine::Utils.random_hex(6)
|
||
|
tokens << token
|
||
|
end
|
||
|
::Mailer.security_notification(
|
||
|
::Mailer.deliver_security_notification(
|
||
|
@user,
|
||
|
User.current,
|
||
|
{
|
||
| ... | ... | |
|
message: 'twofa_mail_body_backup_codes_generated',
|
||
|
url: {controller: 'my', action: 'account'}
|
||
|
}
|
||
|
).deliver
|
||
|
)
|
||
|
tokens
|
||
|
end
|
||