feat: hook syncUser to login callback
Co-authored-by: Ona <no-reply@ona.com>
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
import type { Id } from "../_generated/dataModel"
|
||||
import type { MutationCtx, QueryCtx } from "../_generated/server"
|
||||
import type { AuthenticatedMutationCtx } from "../functions"
|
||||
import * as Err from "./error"
|
||||
|
||||
/**
|
||||
@@ -36,3 +38,9 @@ export async function userOrThrow(ctx: QueryCtx | MutationCtx) {
|
||||
|
||||
return user
|
||||
}
|
||||
|
||||
export async function register(ctx: AuthenticatedMutationCtx) {
|
||||
await ctx.db.insert("users", {
|
||||
jwtSubject: ctx.identity.subject,
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user