Skip to content

Commit

Permalink
fix: avoid catching email callbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
Bekacru committed Nov 27, 2024
1 parent 962712d commit b1519bb
Showing 1 changed file with 8 additions and 15 deletions.
23 changes: 8 additions & 15 deletions packages/better-auth/src/plugins/magic-link/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,21 +116,14 @@ export const magicLink = (options: MagicLinkOptions) => {
}/magic-link/verify?token=${verificationToken}&callbackURL=${
ctx.body.callbackURL || "/"
}`;
try {
await options.sendMagicLink(
{
email,
url,
token: verificationToken,
},
ctx.request,
);
} catch (e) {
ctx.context.logger.error("Failed to send magic link", e);
throw new APIError("INTERNAL_SERVER_ERROR", {
message: "Failed to send magic link",
});
}
await options.sendMagicLink(
{
email,
url,
token: verificationToken,
},
ctx.request,
);
return ctx.json({
status: true,
});
Expand Down

0 comments on commit b1519bb

Please sign in to comment.