Skip to content

Commit

Permalink
Merge pull request #5 from tkey/fix/return-redirectflow
Browse files Browse the repository at this point in the history
fix: return null on redirectflow
  • Loading branch information
himanshuchawla009 authored Oct 13, 2023
2 parents 2f1fea1 + 89ad27c commit 75572c7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/service-provider-torus/src/TorusServiceProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@ class TorusServiceProvider extends ServiceProviderBase {

async triggerLogin(params: SubVerifierDetails): Promise<TorusLoginResponse> {
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;
Expand All @@ -158,6 +161,8 @@ class TorusServiceProvider extends ServiceProviderBase {

async triggerAggregateLogin(params: AggregateLoginParams): Promise<TorusAggregateLoginResponse> {
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");
Expand Down

0 comments on commit 75572c7

Please sign in to comment.