feat: tela de cadastro /register e configurações com perfil completo
- register.vue: cadastro PF/PJ com nome fantasia, razão social, CPF/CNPJ, slug - auto-gera slug a partir do nome fantasia - toggle PF/PJ muda label dos campos dinamicamente - configuracoes.vue: exibe e edita todos os campos do perfil do tenant - auth.global.ts: /register liberado sem autenticação - login.vue: link para /register + remove erro duplicado Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
const PUBLIC_ROUTES = ['/login', '/register']
|
||||
|
||||
export default defineNuxtRouteMiddleware((to) => {
|
||||
const { isAuthenticated } = useAuth()
|
||||
if (!isAuthenticated.value && to.path !== '/login') {
|
||||
if (!isAuthenticated.value && !PUBLIC_ROUTES.includes(to.path)) {
|
||||
return navigateTo('/login')
|
||||
}
|
||||
if (isAuthenticated.value && to.path === '/login') {
|
||||
if (isAuthenticated.value && PUBLIC_ROUTES.includes(to.path)) {
|
||||
return navigateTo('/')
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user