Class: OmniAuth::Strategies::Box
- Inherits:
-
Object
- Object
- OmniAuth::Strategies::Box
- Includes:
- OmniAuth::Strategy
- Defined in:
- lib/omniauth-box.rb
Instance Attribute Summary collapse
-
#auth_token ⇒ Object
Returns the value of attribute auth_token.
Instance Method Summary collapse
- #account ⇒ Object
- #callback_phase ⇒ Object
- #client ⇒ Object
- #raw_info ⇒ Object
- #request_phase ⇒ Object
Instance Attribute Details
#auth_token ⇒ Object
Returns the value of attribute auth_token.
15 16 17 |
# File 'lib/omniauth-box.rb', line 15 def auth_token @auth_token end |
Instance Method Details
#account ⇒ Object
17 18 19 |
# File 'lib/omniauth-box.rb', line 17 def account ::Box::Account.new([:api_token]) end |
#callback_phase ⇒ Object
33 34 35 36 |
# File 'lib/omniauth-box.rb', line 33 def callback_phase self.auth_token = request.params["auth_token"] super end |
#client ⇒ Object
21 22 23 24 25 |
# File 'lib/omniauth-box.rb', line 21 def client client = ::Box::Api.new([:api_token]) client.set_auth_token(self.auth_token) client end |
#raw_info ⇒ Object
50 51 52 |
# File 'lib/omniauth-box.rb', line 50 def raw_info @raw_info ||= client.get_account_info end |
#request_phase ⇒ Object
27 28 29 30 31 |
# File 'lib/omniauth-box.rb', line 27 def request_phase account. do || return redirect end end |