list.rb 385 B

12345678910111213141516171819
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. class Service::User::AccessToken::List < Service::Base
  3. attr_reader :user
  4. def initialize(user)
  5. super()
  6. @user = user
  7. end
  8. def execute
  9. user
  10. .tokens
  11. .without_sensitive_columns
  12. .where(action: 'api', persistent: true)
  13. .reorder(updated_at: :desc, name: :asc)
  14. end
  15. end