From f5326937686aacde11cc4f38d872826ab5bb3ecb Mon Sep 17 00:00:00 2001 From: Chris Tran Date: Tue, 17 Dec 2024 11:52:35 -0600 Subject: [PATCH] chore: update wrappers to use new camelCase props --- src/classes/Auth/Auth.ts | 10 +++------- src/classes/Passage/Passage.ts | 2 +- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/classes/Auth/Auth.ts b/src/classes/Auth/Auth.ts index c6663bb..24e79da 100644 --- a/src/classes/Auth/Auth.ts +++ b/src/classes/Auth/Auth.ts @@ -83,10 +83,8 @@ 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; @@ -98,17 +96,15 @@ 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, + magicLinkPath, + redirectUrl, ttl, }, }); - return response.magic_link; + return response.magicLink; } catch (err) { throw await this.parseError(err, 'Could not create a magic link for this app'); } diff --git a/src/classes/Passage/Passage.ts b/src/classes/Passage/Passage.ts index c6ef887..887b375 100644 --- a/src/classes/Passage/Passage.ts +++ b/src/classes/Passage/Passage.ts @@ -190,7 +190,7 @@ export class Passage { createMagicLinkRequest: args, }); - return response.magic_link; + return response.magicLink; } catch (err) { if (err instanceof ResponseError) { throw await PassageError.fromResponseError(err, 'Could not create a magic link for this app');