123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- class Auth
- class Backend
- class Base
- delegate :user, :password, to: :auth
- attr_reader :config, :auth
-
-
-
-
-
-
-
- def initialize(config, auth)
- @config = config
- @auth = auth
- end
- def valid?
- return false if password.blank? && password_required?
- return false if !perform?
- authenticated?
- end
- private
- def password_required?
- true
- end
- def perform?
- raise NotImplementedError
- end
- def authenticated?
- raise NotImplementedError
- end
- end
- end
- end
|