Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions app/controllers/shipit/github_authentication_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ def callback

session[:user_id] = sign_in_github(auth)

# We need to set this so that the /events and /sidekiq endpoint
# which leverage `UserRequiredMiddleware` will recognize the user
# is authenticated.
session[:authenticated] = true

redirect_to(return_url)
end

Expand Down
1 change: 1 addition & 0 deletions test/controllers/github_authentication_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class GithubAuthenticationControllerTest < ActionController::TestCase
user = User.find_by(login: 'shipit-user')
assert_equal 's3cr3t', user.github_access_token
assert_equal 44, user.github_id
assert session[:authenticated], "Expected session[:authenticated] to be true"
end
end
end