Skip to content

Commit

Permalink
fix: some browser fixes (#590)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-fenster authored and JustinBeckwith committed Jan 9, 2019
1 parent e8d82ca commit d3fb55e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
10 changes: 2 additions & 8 deletions src/auth/oauth2client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -736,15 +736,9 @@ export class OAuth2Client extends AuthClient {
/**
* Generates an URL to revoke the given token.
* @param token The existing token to be revoked.
* @param jsonp If set, append callback= parameter to request JSONP response.
*/
static getRevokeTokenUrl(token: string, jsonp?: string): string {
let parameters = '';
if (jsonp) {
parameters = querystring.stringify({token, 'callback': jsonp});
} else {
parameters = querystring.stringify({token});
}
static getRevokeTokenUrl(token: string): string {
const parameters = querystring.stringify({token});
return `${OAuth2Client.GOOGLE_OAUTH2_REVOKE_URL_}?${parameters}`;
}

Expand Down
4 changes: 3 additions & 1 deletion src/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ export function warn(warning: Warning) {
return;
}
warning.warned = true;
if (!isBrowser() && semver.satisfies(process.version, '>=8')) {
if (isBrowser()) {
console.warn(warning.message);
} else if (semver.satisfies(process.version, '>=8')) {
// @types/node doesn't recognize the emitWarning syntax which
// accepts a config object, so `as any` it is
// https://nodejs.org/docs/latest-v8.x/api/process.html#process_process_emitwarning_warning_options
Expand Down

0 comments on commit d3fb55e

Please sign in to comment.