Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
hooopo committed Dec 16, 2019
1 parent 4a669ba commit e03aa1d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/auth/default_current_user_provider.rb
Original file line number Diff line number Diff line change
Expand Up @@ -141,15 +141,27 @@ def refresh_session(user, session, cookies)
needs_rotation = @user_token.auth_token_seen ? rotated_at < UserAuthToken::ROTATE_TIME.ago : rotated_at < UserAuthToken::URGENT_ROTATE_TIME.ago

if needs_rotation
Rails.logger.debug("rotation")
Rails.logger.debug(user.id)
Rails.logger.debug(@user_token.inspect)
Rails.logger.debug(@user_token.auth_token_seen)
Rails.logger.debug(@user_token.rotated_at)
Rails.logger.debug(UserAuthToken::ROTATE_TIME.ago)
Rails.logger.debug(UserAuthToken::URGENT_ROTATE_TIME.ago)

if @user_token.rotate!(user_agent: @env['HTTP_USER_AGENT'],
client_ip: @request.ip,
path: @env['REQUEST_PATH'])
cookies[TOKEN_COOKIE] = cookie_hash(@user_token.unhashed_auth_token)
Rails.logger.debug("rotate TRUE")
else
Rails.logger.debug("rotate FALSE")
end
end
end

if !user && cookies.key?(TOKEN_COOKIE)
Rails.logger.debug("DELETE COOKIE FROM DefaultCurrentUserProvider/161")
cookies.delete(TOKEN_COOKIE)
end
end
Expand Down

0 comments on commit e03aa1d

Please sign in to comment.