mirror of
https://github.com/linsa-io/linsa.git
synced 2026-01-12 12:20:23 +01:00
feat: feedback (#156)
* minimal tiptap * wip * img edit block * wip * fix
This commit is contained in:
13
web/lib/utils/auth-procedure.ts
Normal file
13
web/lib/utils/auth-procedure.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { currentUser } from "@clerk/nextjs/server"
|
||||
import { createServerActionProcedure, ZSAError } from "zsa"
|
||||
|
||||
export const authedProcedure = createServerActionProcedure()
|
||||
.handler(async () => {
|
||||
try {
|
||||
const clerkUser = await currentUser()
|
||||
return { clerkUser }
|
||||
} catch {
|
||||
throw new ZSAError("NOT_AUTHORIZED", "User not authenticated")
|
||||
}
|
||||
})
|
||||
.createServerAction()
|
||||
Reference in New Issue
Block a user