diff options
author | Robert Speicher <robert@gitlab.com> | 2018-08-13 14:21:37 +0000 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2018-08-13 14:21:37 +0000 |
commit | 6e70e50bcd685fbee9f5413ba66374698e82833c (patch) | |
tree | 993d71eeb30f10af19f66323c288e8ea0a9d13ca | |
parent | 91bd5293a0cc7564bc8f4f23b8bd401a03b75034 (diff) | |
parent | a7e2f96b59035fd4628a047370c87400e16a4b63 (diff) | |
download | gitlab-ce-6e70e50bcd685fbee9f5413ba66374698e82833c.tar.gz |
Merge branch 'sh-fix-issue-50210-oauth2' into 'master'
Fix logins via OAuth2 geting logged out in an hour
Closes #50210
See merge request gitlab-org/gitlab-ce!21144
-rw-r--r-- | app/controllers/application_controller.rb | 2 | ||||
-rw-r--r-- | spec/controllers/application_controller_spec.rb | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 05ed3669a41..e5b38898a67 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -11,7 +11,6 @@ class ApplicationController < ActionController::Base include EnforcesTwoFactorAuthentication include WithPerformanceBar - before_action :limit_unauthenticated_session_times before_action :authenticate_sessionless_user! before_action :authenticate_user! before_action :enforce_terms!, if: :should_enforce_terms? @@ -27,6 +26,7 @@ class ApplicationController < ActionController::Base around_action :set_locale after_action :set_page_title_header, if: :json_request? + after_action :limit_unauthenticated_session_times protect_from_forgery with: :exception, prepend: true diff --git a/spec/controllers/application_controller_spec.rb b/spec/controllers/application_controller_spec.rb index 421ab006792..fbf116e533b 100644 --- a/spec/controllers/application_controller_spec.rb +++ b/spec/controllers/application_controller_spec.rb @@ -162,6 +162,10 @@ describe ApplicationController do describe 'session expiration' do controller(described_class) do + # The anonymous controller will report 401 and fail to run any actions. + # Normally, GitLab will just redirect you to sign in. + skip_before_action :authenticate_user!, only: :index + def index render text: 'authenticated' end |