From 571ca874cd24c7b3d7c15ec888cb9a1b65a447cb Mon Sep 17 00:00:00 2001 From: reslear Date: Tue, 4 Jan 2022 12:17:36 +0800 Subject: [PATCH 1/2] refactor(web): markup `addScopes` web, types --- src/definitions.ts | 6 ++++++ src/web.ts | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/src/definitions.ts b/src/definitions.ts index d576e9f..a9d0028 100644 --- a/src/definitions.ts +++ b/src/definitions.ts @@ -93,4 +93,10 @@ export interface GoogleAuthPlugin { * @since 3.1.0 * */ initialize(options?: Partial): void; + + /** + * Add additional scopes request for user + * @since 3.2.0 + * */ + addScopes(scopes: string[]): Promise; } diff --git a/src/web.ts b/src/web.ts index 4be08ee..4d040fb 100644 --- a/src/web.ts +++ b/src/web.ts @@ -110,6 +110,11 @@ export class GoogleAuthWeb extends WebPlugin implements GoogleAuthPlugin { }); } + async addScopes(scopes: string[]) { + // TODO: web + return; + } + async refresh() { const authResponse = await gapi.auth2.getAuthInstance().currentUser.get().reloadAuthResponse(); return { From eb90ab01bddb69b4e1028b177da3d63799f5602c Mon Sep 17 00:00:00 2001 From: reslear Date: Tue, 4 Jan 2022 12:36:32 +0800 Subject: [PATCH 2/2] refactor: markup `removeScopes` --- src/definitions.ts | 6 ++++++ src/web.ts | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/src/definitions.ts b/src/definitions.ts index a9d0028..f534874 100644 --- a/src/definitions.ts +++ b/src/definitions.ts @@ -99,4 +99,10 @@ export interface GoogleAuthPlugin { * @since 3.2.0 * */ addScopes(scopes: string[]): Promise; + + /** + * Remove additional scopes request for user + * @since 3.2.0 + * */ + removeScopes(scopes: string[]): Promise; } diff --git a/src/web.ts b/src/web.ts index 4d040fb..93c74aa 100644 --- a/src/web.ts +++ b/src/web.ts @@ -115,6 +115,11 @@ export class GoogleAuthWeb extends WebPlugin implements GoogleAuthPlugin { return; } + async removeScopes(scopes: string[]) { + // TODO: web + return; + } + async refresh() { const authResponse = await gapi.auth2.getAuthInstance().currentUser.get().reloadAuthResponse(); return {