Skip to content

Commit 309ec5b

Browse files
author
cubic Bot
committed
Use safeGetAuthUser in checkUpload to ensure mapped userId (merges into #32)
1 parent a00dfb5 commit 309ec5b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

convex/files.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ export const { generateUploadUrl, syncMetadata, onSyncMetadata } = r2.clientApi(
1919
// Provide callbacks reference so the component can invoke onSyncMetadata
2020
callbacks,
2121
checkUpload: async (ctx) => {
22-
const authUser = await ctx.auth.getUserIdentity();
23-
if (authUser === null) {
22+
const authUser = await authComponent.safeGetAuthUser(ctx);
23+
if (!authUser?.userId) {
2424
throw new ConvexError(ERROR_CODES.NOT_AUTHENTICATED);
2525
}
2626
},

0 commit comments

Comments
 (0)