fix: platform library export-verifyEmailCodeUnAuthenticated (#23814)
* fix apiv2 * fix import
This commit is contained in:
1 parent
639940d1bf
commit
a7fecaf578
6 files changed
+10
-11
No files matched your search
@@ -128,7 +128,7 @@ export { checkAdminOrOwner } from "@calcom/features/auth/lib/checkAdminOrOwner";
|
||||
|
||||
export { verifyPhoneNumber, sendVerificationCode };
|
||||
|
||||
export { verifyCodeUnAuthenticated } from "@calcom/trpc/server/routers/viewer/auth/verifyCodeUnAuthenticated.handler";
|
||||
export { verifyCodeUnAuthenticated } from "@calcom/trpc/server/routers/viewer/auth/util";
|
||||
|
||||
export { verifyCode as verifyCodeAuthenticated } from "@calcom/trpc/server/routers/viewer/organizations/verifyCode.handler";
|
||||
|
||||
|
||||
@@ -24,5 +24,5 @@ export const verifyCodeUnAuthenticated = async (email: string, code: string) =>
|
||||
throw new Error("Invalid verification code");
|
||||
}
|
||||
|
||||
return;
|
||||
return true;
|
||||
};
|
||||
@@ -11,8 +11,7 @@ type VerifyTokenOptions = {
|
||||
export const verifyCodeUnAuthenticatedHandler = async ({ input }: VerifyTokenOptions) => {
|
||||
const { email, code } = input;
|
||||
try {
|
||||
await verifyCodeUnAuthenticated(email, code);
|
||||
return true;
|
||||
return await verifyCodeUnAuthenticated(email, code);
|
||||
} catch (error) {
|
||||
throw new TRPCError({ code: "BAD_REQUEST", message: "invalid_code" });
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user