diff options
author | Valery Sizov <vsv2711@gmail.com> | 2015-07-02 13:29:50 +0300 |
---|---|---|
committer | Valery Sizov <vsv2711@gmail.com> | 2015-07-02 13:29:50 +0300 |
commit | 7015ef1b60895ffa2a46b4a41f8f02018f74614c (patch) | |
tree | 401e3adc848ab6913e1f70e5f15a76d1133d86e9 /app/controllers | |
parent | 52e0d4754f70dddbad19b59cda9483152abf0617 (diff) | |
download | gitlab-ci-oauth_everywhere.tar.gz |
Get rid of private message usageoauth_everywhere
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/application_controller.rb | 6 | ||||
-rw-r--r-- | app/controllers/projects_controller.rb | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 9852736..8700317 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -12,6 +12,12 @@ class ApplicationController < ActionController::Base def current_user @current_user ||= session[:current_user] + + # Backward compatibility. Until 7.13 user session doesn't contain access_token + # Users with old session should be logged out + return nil if @current_user && @current_user.access_token.nil? + + @current_user end def sign_in(user) diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 5916df4..f228870 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -79,7 +79,7 @@ class ProjectsController < ApplicationController def destroy project.destroy - Network.new.disable_ci(project.gitlab_id, current_user.private_token) + Network.new.disable_ci(project.gitlab_id, current_user.access_token) EventService.new.remove_project(current_user, project) |