Refactor validity of token authentication

This commit is contained in:
Janis Vaneylen
2022-09-02 14:26:41 +02:00
committed by Sebastian Serth
parent e77223e628
commit b6837e9539
2 changed files with 23 additions and 1 deletions

View File

@ -40,7 +40,10 @@ class ApplicationController < ActionController::Base
token = AuthenticationToken.find_by(shared_secret: params[:token])
return unless token
auto_login(token.user) if token.expire_at.future?
if token.expire_at.future?
token.update(expire_at: Time.zone.now)
auto_login(token.user)
end
end
def set_sentry_context