Skip to content

Commit a7fecaf

Browse files
authored
fix: platform library export-verifyEmailCodeUnAuthenticated (calcom#23814)
* fix apiv2 * fix import
1 parent 639940d commit a7fecaf

6 files changed

Lines changed: 10 additions & 11 deletions

File tree

apps/api/v2/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"@axiomhq/winston": "^1.2.0",
3939
"@calcom/platform-constants": "*",
4040
"@calcom/platform-enums": "*",
41-
"@calcom/platform-libraries": "npm:@calcom/platform-libraries@0.0.356",
41+
"@calcom/platform-libraries": "npm:@calcom/platform-libraries@0.0.358",
4242
"@calcom/platform-types": "*",
4343
"@calcom/platform-utils": "*",
4444
"@calcom/prisma": "*",

apps/api/v2/src/modules/atoms/services/verification-atom.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export class VerificationAtomsService {
2727

2828
async verifyEmailCodeUnAuthenticated(input: VerifyEmailCodeInput) {
2929
try {
30-
return await verifyCodeUnAuthenticated(input);
30+
return await verifyCodeUnAuthenticated(input.email, input.code);
3131
} catch (error) {
3232
if (error instanceof Error) {
3333
if (error.message === "invalid_code") {

packages/platform/libraries/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ export { checkAdminOrOwner } from "@calcom/features/auth/lib/checkAdminOrOwner";
128128

129129
export { verifyPhoneNumber, sendVerificationCode };
130130

131-
export { verifyCodeUnAuthenticated } from "@calcom/trpc/server/routers/viewer/auth/verifyCodeUnAuthenticated.handler";
131+
export { verifyCodeUnAuthenticated } from "@calcom/trpc/server/routers/viewer/auth/util";
132132

133133
export { verifyCode as verifyCodeAuthenticated } from "@calcom/trpc/server/routers/viewer/organizations/verifyCode.handler";
134134

packages/trpc/server/routers/viewer/auth/util.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ export const verifyCodeUnAuthenticated = async (email: string, code: string) =>
2424
throw new Error("Invalid verification code");
2525
}
2626

27-
return;
27+
return true;
2828
};

packages/trpc/server/routers/viewer/auth/verifyCodeUnAuthenticated.handler.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ type VerifyTokenOptions = {
1111
export const verifyCodeUnAuthenticatedHandler = async ({ input }: VerifyTokenOptions) => {
1212
const { email, code } = input;
1313
try {
14-
await verifyCodeUnAuthenticated(email, code);
15-
return true;
14+
return await verifyCodeUnAuthenticated(email, code);
1615
} catch (error) {
1716
throw new TRPCError({ code: "BAD_REQUEST", message: "invalid_code" });
1817
}

yarn.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2715,7 +2715,7 @@ __metadata:
27152715
"@axiomhq/winston": ^1.2.0
27162716
"@calcom/platform-constants": "*"
27172717
"@calcom/platform-enums": "*"
2718-
"@calcom/platform-libraries": "npm:@calcom/platform-libraries@0.0.356"
2718+
"@calcom/platform-libraries": "npm:@calcom/platform-libraries@0.0.358"
27192719
"@calcom/platform-types": "*"
27202720
"@calcom/platform-utils": "*"
27212721
"@calcom/prisma": "*"
@@ -3775,13 +3775,13 @@ __metadata:
37753775
languageName: unknown
37763776
linkType: soft
37773777

3778-
"@calcom/platform-libraries@npm:@calcom/platform-libraries@0.0.356":
3779-
version: 0.0.356
3780-
resolution: "@calcom/platform-libraries@npm:0.0.356"
3778+
"@calcom/platform-libraries@npm:@calcom/platform-libraries@0.0.358":
3779+
version: 0.0.358
3780+
resolution: "@calcom/platform-libraries@npm:0.0.358"
37813781
dependencies:
37823782
"@calcom/features": "*"
37833783
"@calcom/lib": "*"
3784-
checksum: dabce8a4add6c8082f06168ce9fbfef9be258f8ac3c60cb81e1985b4b49e2503f0f539dda9faf371bd1c79133419aed36d0ff849b6a2ecca77e7854752d8c97d
3784+
checksum: 2a3436a24c62c38aa1299237cc2c650826a3cfc9cbffa5cc2f37244abed13dc0f55dbd314037e16af3168b9e7bfa4b62abf20aee00654e8aa24ab4bc7e76c642
37853785
languageName: node
37863786
linkType: hard
37873787

0 commit comments

Comments
 (0)