Skip to content

Commit

Permalink
fix: add condition for test mode
Browse files Browse the repository at this point in the history
  • Loading branch information
sherzod-bakhodirov committed Nov 6, 2024
1 parent ade8393 commit 924a511
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/@magic-sdk/provider/src/modules/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,10 @@ export class UserModule extends BaseModule {

public recoverAccount(configuration: RecoverAccountConfiguration) {
const { email, showUI } = configuration;
const requestPayload = createJsonRpcRequestPayload(MagicPayloadMethod.RecoverAccount, [{ email, showUI }]);
const requestPayload = createJsonRpcRequestPayload(
this.sdk.testMode ? MagicPayloadMethod.RecoverAccountTestMode : MagicPayloadMethod.RecoverAccount,
[{ email, showUI }],
);
const handle = this.request<string | boolean | null, RecoverAccountEventHandlers>(requestPayload);

if (!showUI && handle) {
Expand Down

0 comments on commit 924a511

Please sign in to comment.