Module: WineBouncer::AuthMethods
- Defined in:
- lib/wine_bouncer/auth_methods/auth_methods.rb
Instance Method Summary collapse
- #client_credential_token? ⇒ Boolean
- #doorkeeper_access_token ⇒ Object
- #doorkeeper_access_token=(token) ⇒ Object
- #has_doorkeeper_token? ⇒ Boolean
- #has_resource_owner? ⇒ Boolean
- #protected_endpoint=(protected) ⇒ Object
- #protected_endpoint? ⇒ Boolean
- #resource_owner ⇒ Object
Instance Method Details
#client_credential_token? ⇒ Boolean
18 19 20 |
# File 'lib/wine_bouncer/auth_methods/auth_methods.rb', line 18 def client_credential_token? has_doorkeeper_token? && doorkeeper_access_token.resource_owner_id.nil? end |
#doorkeeper_access_token ⇒ Object
22 23 24 |
# File 'lib/wine_bouncer/auth_methods/auth_methods.rb', line 22 def doorkeeper_access_token @_doorkeeper_access_token end |
#doorkeeper_access_token=(token) ⇒ Object
26 27 28 |
# File 'lib/wine_bouncer/auth_methods/auth_methods.rb', line 26 def doorkeeper_access_token=(token) @_doorkeeper_access_token = token end |
#has_doorkeeper_token? ⇒ Boolean
30 31 32 |
# File 'lib/wine_bouncer/auth_methods/auth_methods.rb', line 30 def has_doorkeeper_token? !@_doorkeeper_access_token.nil? end |
#has_resource_owner? ⇒ Boolean
34 35 36 |
# File 'lib/wine_bouncer/auth_methods/auth_methods.rb', line 34 def has_resource_owner? has_doorkeeper_token? && !!doorkeeper_access_token.resource_owner_id end |
#protected_endpoint=(protected) ⇒ Object
6 7 8 |
# File 'lib/wine_bouncer/auth_methods/auth_methods.rb', line 6 def protected_endpoint=(protected) @protected_endpoint = protected end |
#protected_endpoint? ⇒ Boolean
10 11 12 |
# File 'lib/wine_bouncer/auth_methods/auth_methods.rb', line 10 def protected_endpoint? @protected_endpoint || false end |
#resource_owner ⇒ Object
14 15 16 |
# File 'lib/wine_bouncer/auth_methods/auth_methods.rb', line 14 def resource_owner instance_eval(&WineBouncer.configuration.defined_resource_owner) end |