Skip to content
Closed
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
1 change: 1 addition & 0 deletions app/controllers/sessions_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
class SessionsController < ApplicationController
skip_before_action :check_user_token
skip_before_action :check_session_expiry

def create
auth = request.env["omniauth.auth"]
Expand Down
14 changes: 11 additions & 3 deletions test/controllers/sessions_controller_test.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
require "test_helper"

class SessionsControllerTest < ActionDispatch::IntegrationTest
# test "the truth" do
# assert true
# end
test "completes OAuth even when session has expired" do
# Sign in so the session gets an expires_at timestamp.
sign_in

# Travel past the expiry window so check_session_expiry would fire.
# Without the fix, it renders puzzles/login and the OAuth callback never completes.
travel_to 2.hours.from_now do
sign_in
assert_redirected_to root_path
end
end
end