Class: OmniAuth::Strategies::Todoist
- Inherits:
-
OAuth2
- Object
- OAuth2
- OmniAuth::Strategies::Todoist
- Defined in:
- lib/omniauth/strategies/todoist.rb
Constant Summary collapse
- DEFAULT_SCOPE =
'data:read'
Instance Method Summary collapse
- #callback_phase ⇒ Object
-
#callback_url ⇒ Object
Bugfix for regression introduced after omniauth-oauth2 v1.3.1 details: github.com/intridea/omniauth-oauth2/issues/81.
- #raw_info ⇒ Object
- #request_phase ⇒ Object
Instance Method Details
#callback_phase ⇒ Object
39 40 41 |
# File 'lib/omniauth/strategies/todoist.rb', line 39 def callback_phase super end |
#callback_url ⇒ Object
Bugfix for regression introduced after omniauth-oauth2 v1.3.1 details: github.com/intridea/omniauth-oauth2/issues/81
45 46 47 |
# File 'lib/omniauth/strategies/todoist.rb', line 45 def callback_url [:callback_url] || full_host + script_name + callback_path end |
#raw_info ⇒ Object
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/omniauth/strategies/todoist.rb', line 49 def raw_info unless @raw_info user_info = access_token.post("/API/v7/sync", { body: { token: access_token.token, sync_token: "*", resource_types: '["user"]' }, headers: { "Content-Type"=>"application/x-www-form-urlencoded" } }).parsed if user_info["user"] @raw_info = user_info["user"] else @raw_info = {} end end @raw_info end |
#request_phase ⇒ Object
35 36 37 |
# File 'lib/omniauth/strategies/todoist.rb', line 35 def request_phase super end |