Class: OmniAuth::Strategies::Line
- Inherits:
-
OAuth2
- Object
- OAuth2
- OmniAuth::Strategies::Line
- Defined in:
- lib/omniauth/strategies/line.rb
Instance Method Summary collapse
-
#callback_phase ⇒ Object
host changed.
- #callback_url ⇒ Object
- #fetch_email ⇒ Object
-
#raw_info ⇒ Object
Require: Access token with PROFILE permission issued.
Instance Method Details
#callback_phase ⇒ Object
host changed
17 18 19 20 |
# File 'lib/omniauth/strategies/line.rb', line 17 def callback_phase [:client_options][:site] = 'https://api.line.me' super end |
#callback_url ⇒ Object
22 23 24 25 |
# File 'lib/omniauth/strategies/line.rb', line 22 def callback_url # Fixes regression in omniauth-oauth2 v1.4.0 by https://github.com/intridea/omniauth-oauth2/commit/85fdbe117c2a4400d001a6368cc359d88f40abc7 [:callback_url] || (full_host + script_name + callback_path) end |
#fetch_email ⇒ Object
46 47 48 49 50 51 |
# File 'lib/omniauth/strategies/line.rb', line 46 def fetch_email data = JSON.load(access_token.post('oauth2/v2.1/verify', params: { id_token: access_token.params['id_token'], client_id: ['client_id'] }).body) data['email'] rescue ::Errno::ETIMEDOUT raise ::Timeout::Error end |
#raw_info ⇒ Object
Require: Access token with PROFILE permission issued.
40 41 42 43 44 |
# File 'lib/omniauth/strategies/line.rb', line 40 def raw_info @raw_info ||= JSON.load(access_token.get('v2/profile').body) rescue ::Errno::ETIMEDOUT raise ::Timeout::Error end |