Skip to content
Snippets Groups Projects

[WIP] Moves the stage and ref from the table in a ci commit build to a plain one line text

Closed Tiago Botelho requested to merge tiagonbotelho/gitlab-ce:ci-commit into master
4 files
+ 22
25
Compare changes
  • Side-by-side
  • Inline
Files
4
class Profiles::AccountsController < Profiles::ApplicationController
class Profiles::AccountsController < Profiles::ApplicationController
 
skip_before_action :check_2fa_requirement
 
def show
def show
unless current_user.otp_secret
unless current_user.otp_secret
current_user.otp_secret = User.generate_otp_secret(32)
current_user.otp_secret = User.generate_otp_secret(32)
@@ -10,6 +12,15 @@ def show
@@ -10,6 +12,15 @@ def show
current_user.save! if current_user.changed?
current_user.save! if current_user.changed?
 
if two_factor_authentication_required?
 
if two_factor_grace_period_expired?
 
flash.now[:alert] = 'You must enable Two-factor Authentication for your account.'
 
else
 
grace_period_deadline = current_user.otp_grace_period_started_at + two_factor_grace_period.hours
 
flash.now[:alert] = "You must enable Two-factor Authentication for your account before #{l(grace_period_deadline)}."
 
end
 
end
 
@user = current_user
@user = current_user
@qr_code = build_qr_code
@qr_code = build_qr_code
Loading