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 defineNuxtRouteMiddleware(async (to, from) => {
|
||||
if (import.meta.server) return
|
||||
|
||||
const { $authClient } = useNuxtApp()
|
||||
const session = $authClient.useSession()
|
||||
|
||||
if (session.value.isPending || !session.value) {
|
||||
if (to.path === "/dashboard") {
|
||||
return navigateTo("/login");
|
||||
}
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user