feat(api): add last_authenticated_at timestamp to api requests

This commit is contained in:
Paul Chavard 2023-08-01 12:30:23 +02:00
parent a8f7ce77c3
commit e9cb50d09c
7 changed files with 31 additions and 4 deletions

View file

@ -39,7 +39,9 @@ class API::V2::BaseController < ApplicationController
def api_token
if @api_token.nil?
@api_token = APIToken.find_and_verify(authorization_bearer_token) || false
@api_token = APIToken
.find_and_verify(authorization_bearer_token)
&.tap { _1.touch(:last_v2_authenticated_at) } || false
end
@api_token
end