backend.rb 496 B

12345678910111213141516171819202122232425262728293031323334
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. class Auth::AfterAuth::Backend
  3. def self.run(...)
  4. new(...).run
  5. end
  6. def self.type
  7. name.demodulize
  8. end
  9. attr_accessor :user, :session, :data
  10. def initialize(user:, session:)
  11. @user = user
  12. @session = session
  13. @data = {}
  14. end
  15. def run
  16. return nil if !check
  17. {
  18. type: self.class.type,
  19. data: data,
  20. }
  21. end
  22. private
  23. def check
  24. raise NotImplementedError
  25. end
  26. end