Skip to content

Commit

Permalink
chore: update wrappers to use new camelCase props
Browse files Browse the repository at this point in the history
  • Loading branch information
ctran88 committed Dec 17, 2024
1 parent 6719b43 commit f532693
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
10 changes: 3 additions & 7 deletions src/classes/Auth/Auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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');
}
Expand Down
2 changes: 1 addition & 1 deletion src/classes/Passage/Passage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit f532693

Please sign in to comment.