admin_password_auth_verify.rb 555 B

1234567891011121314151617181920212223
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. module Gql::Mutations
  3. class AdminPasswordAuthVerify < BaseMutation
  4. description 'Verify admin password authentication'
  5. argument :token, String, description: 'Token to verify'
  6. field :login, String, null: true, description: 'Login of the user'
  7. def self.authorize(_obj, _ctx)
  8. true
  9. end
  10. def resolve(token:)
  11. verify = Service::Auth::VerifyAdminToken.new(token: token)
  12. user = verify.execute
  13. { login: user.login }
  14. end
  15. end
  16. end