Skip to content

Commit

Permalink
Firefox & Cache Improvements (#77)
Browse files Browse the repository at this point in the history
* Add a small timeout before closing the modal to give Firefox time to open the link
* Set a more reasonable token lifespan length as the default is 6 hours
  • Loading branch information
Blacksmoke16 authored Jan 18, 2021
1 parent 0405a3e commit 74006ce
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
9 changes: 6 additions & 3 deletions src/script/authorize.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@
<head>
<meta charset="UTF-8">
<title>Authorize Character</title>
<script type="application/javascript">
function closeAuthModal() {
setTimeout( function() { google.script.host.close(); }, 500);
}
</script>
</head>
<body>
<p>Click the link below to authorize a character for use in GESI:</p>
<a href="<?= authorizationUrl ?>" target="_blank"><img onclick="google.script.host.close();" alt="Authorize with EVE SSO" src="https://web.ccpgamescdn.com/eveonlineassets/developers/eve-sso-login-black-small.png"/></a>
<br>
<p>NOTE: If using Firefox, right click on the link and open it in a new tab.</p>
<a href="<?= authorizationUrl ?>" target="_blank" onclick="closeAuthModal()"><img alt="Authorize with EVE SSO" src="https://web.ccpgamescdn.com/eveonlineassets/developers/eve-sso-login-black-small.png"/></a>
</body>
</html>
10 changes: 2 additions & 8 deletions src/script/gesi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,13 +240,6 @@ function getClient(characterName?: string): ESIClient {
return new ESIClient(oauthService, characterData);
}

/**
* @internal
*/
function getClientInternal(id: string, refreshToken: string, characterData: IAuthenticatedCharacter): ESIClient {
return new ESIClient(getOAuthService_(id, refreshToken), characterData);
}

/**
* Returns the data from the provided functionName for each character as one list for use within a sheet.
*
Expand Down Expand Up @@ -377,7 +370,8 @@ function getOAuthService_(id: string, refreshToken?: string): OAuth2Service {
} else {
service
.setPropertyStore(getDocumentProperties_())
.setCache(getDocumentCache_());
.setCache(getDocumentCache_())
.setExpirationMinutes('18');
}

return service;
Expand Down

0 comments on commit 74006ce

Please sign in to comment.