mirror of
https://github.com/simi/omniauth-facebook.git
synced 2022-11-09 12:32:45 -05:00
Add 'state' to authorization params.
More information on https://developers.facebook.com/docs/reference/dialogs/oauth/
This commit is contained in:
parent
991ce4c89f
commit
8942552571
2 changed files with 7 additions and 0 deletions
|
@ -88,6 +88,7 @@ module OmniAuth
|
|||
def authorize_params
|
||||
super.tap do |params|
|
||||
params.merge!(:display => request.params['display']) if request.params['display']
|
||||
params.merge!(:state => request.params['state']) if request.params['state']
|
||||
params[:scope] ||= DEFAULT_SCOPE
|
||||
end
|
||||
end
|
||||
|
|
|
@ -62,6 +62,12 @@ describe OmniAuth::Strategies::Facebook do
|
|||
subject.authorize_params.should be_a(Hash)
|
||||
subject.authorize_params[:display].should eq('touch')
|
||||
end
|
||||
|
||||
it 'includes state parameter from request when present' do
|
||||
@request.stub(:params) { { 'state' => 'some_state' } }
|
||||
subject.authorize_params.should be_a(Hash)
|
||||
subject.authorize_params[:state].should eq('some_state')
|
||||
end
|
||||
end
|
||||
|
||||
describe '#token_params' do
|
||||
|
|
Loading…
Reference in a new issue