diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-04-02 21:57:36 +0300 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2015-05-10 00:31:39 +0300 |
commit | 8ae712ae28eda669987c48a755fc9f94ac48b5e7 (patch) | |
tree | 92569654f459aaea0b475c66dd263259c2a7b6c0 /app/controllers/profiles | |
parent | 802fcd051fcbc9be99230bddb13c4a7cb8067741 (diff) |
Render 2fa recovery codes instead of downloading it
Diffstat (limited to 'app/controllers/profiles')
-rw-r--r-- | app/controllers/profiles/two_factor_auths_controller.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/controllers/profiles/two_factor_auths_controller.rb b/app/controllers/profiles/two_factor_auths_controller.rb index 2841a07efbc..5c51706c3d4 100644 --- a/app/controllers/profiles/two_factor_auths_controller.rb +++ b/app/controllers/profiles/two_factor_auths_controller.rb @@ -11,9 +11,10 @@ class Profiles::TwoFactorAuthsController < ApplicationController def create if current_user.valid_otp?(params[:pin_code]) current_user.otp_required_for_login = true + @codes = current_user.generate_otp_backup_codes! current_user.save! - redirect_to profile_account_path + render 'create' else @error = 'Invalid pin code' @qr_code = build_qr_code @@ -22,9 +23,8 @@ class Profiles::TwoFactorAuthsController < ApplicationController end def codes - codes = current_user.generate_otp_backup_codes! + @codes = current_user.generate_otp_backup_codes! current_user.save! - send_data codes.join("\n"), filename: 'gitlab_recovery_codes.txt' end def destroy |