mirror of
https://github.com/FranP-code/create-better-t-stack.git
synced 2025-10-12 23:52:15 +00:00
feat: add clerk auth support with convex (#548)
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
export default {
|
||||
providers: [
|
||||
{
|
||||
// Replace with your own Clerk Issuer URL from your "convex" JWT template
|
||||
// or with `process.env.CLERK_JWT_ISSUER_DOMAIN`
|
||||
// and configure CLERK_JWT_ISSUER_DOMAIN on the Convex Dashboard
|
||||
// See https://docs.convex.dev/auth/clerk#configuring-dev-and-prod-instances
|
||||
domain: process.env.CLERK_JWT_ISSUER_DOMAIN,
|
||||
applicationID: "convex",
|
||||
},
|
||||
],
|
||||
};
|
||||
@@ -0,0 +1,16 @@
|
||||
import { query } from "./_generated/server";
|
||||
|
||||
export const get = query({
|
||||
args: {},
|
||||
handler: async (ctx) => {
|
||||
const identity = await ctx.auth.getUserIdentity();
|
||||
if (identity === null) {
|
||||
return {
|
||||
message: "Not authenticated",
|
||||
};
|
||||
}
|
||||
return {
|
||||
message: "This is private",
|
||||
};
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user