Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Apr 18, 2024. It is now read-only.

Commit 45ee9eb

Browse files
committed
Fix demo bug where unverified scope access token was displayed.
1 parent a2d4444 commit 45ee9eb

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

example/js/demo.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,13 @@ angular.module('demo', ['googleOauth']).
2626
.then(function(params) {
2727
// Success getting token from popup.
2828

29-
var accessToken = params.access_token;
30-
$scope.accessToken = accessToken;
31-
$scope.expiresIn = params.expires_in;
32-
3329
// Verify the token before setting it, to avoid the confused deputy problem.
34-
Token.verifyAsync(accessToken).
30+
Token.verifyAsync(params.access_token).
3531
then(function(data) {
36-
Token.set(accessToken);
32+
$scope.accessToken = params.access_token;
33+
$scope.expiresIn = params.expires_in;
34+
35+
Token.set(params.access_token);
3736
}, function() {
3837
alert("Failed to verify token.")
3938
});

0 commit comments

Comments
 (0)