Skip to content

Commit

Permalink
make initialize return a Promise (#328)
Browse files Browse the repository at this point in the history
closes #152
  • Loading branch information
luca-peruzzo authored Nov 29, 2023
1 parent c020704 commit 110d7f7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export interface GoogleAuthPlugin {
* @param options - Optional initialization options.
* @since 3.1.0
*/
initialize(options?: InitOptions): void;
initialize(options?: InitOptions): Promise<void>;

/**
* Initiates the sign-in process and returns a Promise that resolves with the user information.
Expand Down
3 changes: 2 additions & 1 deletion src/web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class GoogleAuthWeb extends WebPlugin implements GoogleAuthPlugin {
scopes: [],
grantOfflineAccess: false,
}
) {
): Promise<void> {
if (typeof window === 'undefined') {
return;
}
Expand All @@ -64,6 +64,7 @@ export class GoogleAuthWeb extends WebPlugin implements GoogleAuthPlugin {
});

this.addUserChangeListener();
return this.gapiLoaded;
}

platformJsLoaded() {
Expand Down

0 comments on commit 110d7f7

Please sign in to comment.