Skip to content

Commit b76bedb

Browse files
committed
change status to errored and emit errored event
1 parent c24f5dd commit b76bedb

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/no-modal/src/noModal.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -517,15 +517,16 @@ export class Web3AuthNoModal extends SafeEventEmitter<Web3AuthNoModalEvents> imp
517517
// when ssr is enabled, we need to get the idToken from the connector.
518518
if (this.coreOptions.ssr) {
519519
try {
520-
// TODO: handle the idToken being expired if saved in storage.
521520
const data = await connector.authenticateUser();
522521
if (!data.idToken) throw WalletLoginError.connectionError("No idToken found");
523522
this.setState({
524523
idToken: data.idToken,
525524
});
526525
} catch (error) {
527526
log.error(error);
528-
throw error;
527+
this.status = CONNECTOR_STATUS.ERRORED;
528+
this.emit(CONNECTOR_EVENTS.ERRORED, error as Web3AuthError);
529+
return;
529530
}
530531
}
531532

0 commit comments

Comments
 (0)