This prevents consecutive requests to the /authorized endpoint from requesting authorization multiple times to Google (only the first time succeeds).
This commit is contained in:
parent
6372f2d382
commit
adfe1aa925
@ -105,6 +105,9 @@ function process(path, request, response) {
|
|||||||
context.state = request.getParameter("state");
|
context.state = request.getParameter("state");
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
|
if (Packages.com.google.refine.extension.gdata.TokenCookie.getToken(request) !== null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
var tokenAndExpiresInSeconds = Packages.com.google.refine.extension.gdata.GoogleAPIExtension.getTokenFromCode(module,request);
|
var tokenAndExpiresInSeconds = Packages.com.google.refine.extension.gdata.GoogleAPIExtension.getTokenFromCode(module,request);
|
||||||
if (tokenAndExpiresInSeconds) {
|
if (tokenAndExpiresInSeconds) {
|
||||||
var tokenInfo = tokenAndExpiresInSeconds.split(",");
|
var tokenInfo = tokenAndExpiresInSeconds.split(",");
|
||||||
|
Loading…
Reference in New Issue
Block a user