summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorTiago Botelho <tiagonbotelho@hotmail.com>2017-09-13 12:18:15 +0100
committerDouwe Maan <douwe@selenight.nl>2017-11-20 18:02:41 +0100
commit053a1988467acecfdc941f13f183d28fb0a11f1c (patch)
tree5208f0b550a6016ecf7f771699892a33f42936a5 /app
parent7a61a8e09bcab5e0cb37ddb13900a5c07ef18918 (diff)
downloadgitlab-ce-053a1988467acecfdc941f13f183d28fb0a11f1c.tar.gz
Impersonation no longer gets stuck on password change.
Diffstat (limited to 'app')
-rw-r--r--app/controllers/application_controller.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 2087fe81411..b2ec491146f 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -196,7 +196,11 @@ class ApplicationController < ActionController::Base
end
def check_password_expiration
- if current_user && current_user.password_expires_at && current_user.password_expires_at < Time.now && !current_user.ldap_user?
+ return if session[:impersonator_id] || current_user&.ldap_user?
+
+ password_expires_at = current_user&.password_expires_at
+
+ if password_expires_at && password_expires_at < Time.now
return redirect_to new_profile_password_path
end
end