Class: OmniAuth::Strategies::VkontakteOpenApi
- Inherits:
-
Object
- Object
- OmniAuth::Strategies::VkontakteOpenApi
- Includes:
- ViewHelper::PageHelper, OmniAuth::Strategy
- Defined in:
- lib/omniauth/strategies/vkontakte_open_api.rb,
lib/omniauth/strategies/vkontakte_open_api/view_helper.rb
Defined Under Namespace
Classes: ViewHelper
Instance Attribute Summary collapse
-
#app_id ⇒ Object
readonly
Returns the value of attribute app_id.
Instance Method Summary collapse
- #auth_hash ⇒ Object
-
#initialize(app, app_id, options = {}) ⇒ VkontakteOpenApi
constructor
A new instance of VkontakteOpenApi.
- #request_phase ⇒ Object
Methods included from ViewHelper::PageHelper
#vkontakte_footer, #vkontakte_header, #vkontakte_login_button, #vkontakte_login_page
Constructor Details
#initialize(app, app_id, options = {}) ⇒ VkontakteOpenApi
Returns a new instance of VkontakteOpenApi.
16 17 18 19 20 |
# File 'lib/omniauth/strategies/vkontakte_open_api.rb', line 16 def initialize(app, app_id, = {}) @options = OmniAuth.config.vkontakte_app_id = app_id super(app, :vkontakte) end |
Instance Attribute Details
#app_id ⇒ Object (readonly)
Returns the value of attribute app_id.
22 23 24 |
# File 'lib/omniauth/strategies/vkontakte_open_api.rb', line 22 def app_id @app_id end |
Instance Method Details
#auth_hash ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/omniauth/strategies/vkontakte_open_api.rb', line 28 def auth_hash OmniAuth::Utils.deep_merge(super(), { 'uid' => request[:uid], 'user_info' => { 'nickname' => request[:nickname], 'name' => "#{request[:first_name]} #{request[:last_name]}", 'first_name' => request[:first_name], 'last_name' => request[:last_name], 'image' => request[:photo], 'urls' => { 'Page' => 'http://vkontakte.ru/id' + request[:uid] } } }) end |
#request_phase ⇒ Object
24 25 26 |
# File 'lib/omniauth/strategies/vkontakte_open_api.rb', line 24 def request_phase Rack::Response.new(vkontakte_login_page).finish end |