You've already forked agentic-coding-workflow
feat(web): prompt-templates view + chat/admin routes + nav + isAdmin guard
This commit is contained in:
@@ -53,6 +53,7 @@ export const useAuthStore = defineStore('auth', () => {
|
||||
const user = ref<User | null>(safeReadJSON<User | null>('user', null))
|
||||
|
||||
const isAuthenticated = computed(() => !!token.value)
|
||||
const isAdmin = computed(() => !!user.value?.is_admin)
|
||||
|
||||
function setSession(t: string, u: User) {
|
||||
token.value = t
|
||||
@@ -68,5 +69,5 @@ export const useAuthStore = defineStore('auth', () => {
|
||||
safeRemove('user')
|
||||
}
|
||||
|
||||
return { token, user, isAuthenticated, setSession, clearSession }
|
||||
return { token, user, isAuthenticated, isAdmin, setSession, clearSession }
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user