diff --git a/packages/service-provider-torus/src/TorusServiceProvider.ts b/packages/service-provider-torus/src/TorusServiceProvider.ts index ddaede48..c9e835b4 100644 --- a/packages/service-provider-torus/src/TorusServiceProvider.ts +++ b/packages/service-provider-torus/src/TorusServiceProvider.ts @@ -147,6 +147,9 @@ class TorusServiceProvider extends ServiceProviderBase { async triggerLogin(params: SubVerifierDetails): Promise { const obj = await this.customAuthInstance.triggerLogin(params); + // incase of redirectflow which return null + if (!obj) return; + const localPrivKey = Torus.getPostboxKey(obj); this.postboxKey = new BN(localPrivKey, "hex"); const { verifier, verifierId } = obj.userInfo; @@ -158,6 +161,8 @@ class TorusServiceProvider extends ServiceProviderBase { async triggerAggregateLogin(params: AggregateLoginParams): Promise { const obj = await this.customAuthInstance.triggerAggregateLogin(params); + // incase of redirectflow which return null + if (!obj) return; const localPrivKey = Torus.getPostboxKey(obj); this.postboxKey = new BN(localPrivKey, "hex");