Files
adamantium/slices/admin/commands/sessions/validate.rb
2023-12-02 20:36:29 +11:00

21 lines
404 B
Ruby

module Admin
module Commands
module Sessions
class Validate
include Deps["repos.login_tokens_repo"]
def call(token:)
token = login_tokens_repo.by_token(token: token)
if (Time.now - token.created_at) > (15 * 60)
login_tokens_repo.delete_all
return nil
end
token.user_id
end
end
end
end
end