From 4553f168524b4644406ebf23b068e8f26c958e84 Mon Sep 17 00:00:00 2001 From: Chris Tran Date: Fri, 13 Dec 2024 18:36:42 -0600 Subject: [PATCH] fix: createMagicLink now correctly transforms the "userId" parameter --- src/classes/Auth/Auth.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/classes/Auth/Auth.ts b/src/classes/Auth/Auth.ts index b9358b4..c6663bb 100644 --- a/src/classes/Auth/Auth.ts +++ b/src/classes/Auth/Auth.ts @@ -83,8 +83,10 @@ export class Auth extends PassageBase { try { const { language, magicLinkPath, redirectUrl, ttl } = options ?? {}; + let userId: string | undefined = undefined; let channel: MagicLinkChannel; if ('userId' in args) { + userId = args.userId; channel = args.channel; } else if ('email' in args) { channel = MagicLinkChannel.Email; @@ -96,11 +98,13 @@ export class Auth extends PassageBase { appId: this.config.appId, createMagicLinkRequest: { ...args, + // eslint-disable-next-line camelcase + user_id: userId, + channel, language, magic_link_path: magicLinkPath, redirect_url: redirectUrl, ttl, - channel, }, });