Skip to content

Commit

Permalink
added showUI back to auth module for email otp
Browse files Browse the repository at this point in the history
  • Loading branch information
mushfichowdhury-magic committed Nov 17, 2022
1 parent 66d9654 commit 671c9b3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/@magic-sdk/provider/src/modules/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export class AuthModule extends BaseModule {
const { email } = configuration;
const requestPayload = createJsonRpcRequestPayload(
this.sdk.testMode ? MagicPayloadMethod.LoginWithEmailOTPTestMode : MagicPayloadMethod.LoginWithEmailOTP,
[{ email }],
[{ email, showUI: true }],
);
return this.request<string | null, LoginWithEmailOTPEvents>(requestPayload);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ test('Generates JSON RPC request payload with `email` parameter', async () => {
const requestPayload = magic.auth.request.mock.calls[0][0];
expect(requestPayload.jsonrpc).toBe('2.0');
expect(requestPayload.method).toBe(MagicPayloadMethod.LoginWithEmailOTP);
expect(requestPayload.params).toEqual([{ email: expectedEmail }]);
expect(requestPayload.params).toEqual([{ email: expectedEmail, showUI: true }]);
});

test('If `testMode` is enabled, testing-specific RPC method is used', async () => {
Expand All @@ -34,7 +34,7 @@ test('If `testMode` is enabled, testing-specific RPC method is used', async () =
const requestPayload = magic.auth.request.mock.calls[0][0];
expect(requestPayload.jsonrpc).toBe('2.0');
expect(requestPayload.method).toBe(MagicPayloadMethod.LoginWithEmailOTPTestMode);
expect(requestPayload.params).toEqual([{ email: expectedEmail }]);
expect(requestPayload.params).toEqual([{ email: expectedEmail, showUI: true }]);
});

test('method should return a PromiEvent', () => {
Expand Down

0 comments on commit 671c9b3

Please sign in to comment.