diff options
author | rmsousa@chromium.org <rmsousa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-08 22:07:55 +0000 |
---|---|---|
committer | rmsousa@chromium.org <rmsousa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-08 22:07:55 +0000 |
commit | cb49fc91f70d9aaa57255f2b51286c4aeda9b59a (patch) | |
tree | 0c4ee0aeefc55c99068dde64776c0c8086969169 /remoting/webapp/oauth2_callback.js | |
parent | 6ed72be9850bc59df02b0ec19ce44cfabc805656 (diff) | |
download | chromium_src-cb49fc91f70d9aaa57255f2b51286c4aeda9b59a.zip chromium_src-cb49fc91f70d9aaa57255f2b51286c4aeda9b59a.tar.gz chromium_src-cb49fc91f70d9aaa57255f2b51286c4aeda9b59a.tar.bz2 |
Add state parameter to OAuth redirect
BUG=168225
Review URL: https://chromiumcodereview.appspot.com/11740036
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@175596 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/webapp/oauth2_callback.js')
-rw-r--r-- | remoting/webapp/oauth2_callback.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/remoting/webapp/oauth2_callback.js b/remoting/webapp/oauth2_callback.js index b5c0558..6d94dca 100644 --- a/remoting/webapp/oauth2_callback.js +++ b/remoting/webapp/oauth2_callback.js @@ -21,11 +21,13 @@ function retrieveRefreshToken() { var pair = parts[i].split('='); queryArgs[pair[0]] = pair[1]; } - if ('code' in queryArgs) { + + if ('code' in queryArgs && 'state' in queryArgs) { var oauth2 = new remoting.OAuth2(); - oauth2.exchangeCodeForToken(queryArgs['code'], function() { - window.location.replace(chrome.extension.getURL('main.html')); - }); + oauth2.exchangeCodeForToken(queryArgs['code'], queryArgs['state'], + function() { + window.location.replace(chrome.extension.getURL('main.html')); + }); } else { window.location.replace(chrome.extension.getURL('main.html')); } |