Class: OmniAuth::Strategies::MailRuApi
- Inherits:
-
Object
- Object
- OmniAuth::Strategies::MailRuApi
- Includes:
- ViewHelper::PageHelper, OmniAuth::Strategy
- Defined in:
- lib/omniauth/strategies/mailru_api.rb,
lib/omniauth/strategies/mailru_api/view_helper.rb
Defined Under Namespace
Classes: ViewHelper
Instance Attribute Summary collapse
-
#app_id ⇒ Object
readonly
Returns the value of attribute app_id.
-
#app_private_key ⇒ Object
readonly
Returns the value of attribute app_private_key.
Instance Method Summary collapse
- #auth_hash ⇒ Object
-
#initialize(app, app_id, app_private_key, options = {}) ⇒ MailRuApi
constructor
A new instance of MailRuApi.
- #request_phase ⇒ Object
Methods included from ViewHelper::PageHelper
#mailru_footer, #mailru_header, #mailru_login_button, #mailru_login_page
Constructor Details
#initialize(app, app_id, app_private_key, options = {}) ⇒ MailRuApi
Returns a new instance of MailRuApi.
16 17 18 19 20 21 |
# File 'lib/omniauth/strategies/mailru_api.rb', line 16 def initialize(app, app_id, app_private_key, = {}) OmniAuth.config.mailru_app_id = app_id OmniAuth.config.mailru_private_key = app_private_key @options = super(app, :mailru) end |
Instance Attribute Details
#app_id ⇒ Object (readonly)
Returns the value of attribute app_id.
23 24 25 |
# File 'lib/omniauth/strategies/mailru_api.rb', line 23 def app_id @app_id end |
#app_private_key ⇒ Object (readonly)
Returns the value of attribute app_private_key.
24 25 26 |
# File 'lib/omniauth/strategies/mailru_api.rb', line 24 def app_private_key @app_private_key end |
Instance Method Details
#auth_hash ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/omniauth/strategies/mailru_api.rb', line 30 def auth_hash OmniAuth::Utils.deep_merge(super(), { 'uid' => request[:uid], 'user_info' => { 'nick' => request[:nick], 'email' => request[:email], 'name' => "#{request[:first_name]} #{request[:last_name]}", 'first_name' => request[:first_name], 'last_name' => request[:last_name], 'picture' => request[:has_pic] ? request[:pic] : nil, 'country' => request[:country], 'town' => request[:city], 'urls' => { 'Page' => request[:link] } }, 'extra' => {'user_hash' => request} }) end |
#request_phase ⇒ Object
26 27 28 |
# File 'lib/omniauth/strategies/mailru_api.rb', line 26 def request_phase Rack::Response.new(mailru_login_page).finish end |