feat: versão 1.5 - CRM Beta com leads, funis, campanhas e portal do cliente
This commit is contained in:
@@ -137,12 +137,20 @@ export default function LoginPage() {
|
||||
|
||||
saveAuth(data.token, data.user);
|
||||
|
||||
console.log('Login successful:', data.user);
|
||||
console.log('Login successful:', data);
|
||||
|
||||
setSuccessMessage('Login realizado com sucesso! Redirecionando você agora...');
|
||||
|
||||
setTimeout(() => {
|
||||
const target = isSuperAdmin ? '/superadmin' : '/dashboard';
|
||||
// Redirecionar baseado no tipo de usuário
|
||||
let target = '/dashboard';
|
||||
|
||||
if (isSuperAdmin) {
|
||||
target = '/superadmin';
|
||||
} else if (data.user_type === 'customer') {
|
||||
target = '/cliente/dashboard';
|
||||
}
|
||||
|
||||
window.location.href = target;
|
||||
}, 1000);
|
||||
} catch (error: any) {
|
||||
@@ -291,18 +299,30 @@ export default function LoginPage() {
|
||||
{isLoading ? 'Entrando...' : 'Entrar'}
|
||||
</Button>
|
||||
|
||||
{/* Link para cadastro - apenas para agências */}
|
||||
{/* Link para cadastro - agências e clientes */}
|
||||
{!isSuperAdmin && (
|
||||
<p className="text-center text-[14px] text-[#7D7D7D] dark:text-gray-400">
|
||||
Ainda não tem conta?{' '}
|
||||
<a
|
||||
href="http://dash.localhost/cadastro"
|
||||
className="font-medium hover:opacity-80 transition-opacity"
|
||||
style={{ color: 'var(--brand-color)' }}
|
||||
>
|
||||
Cadastre sua agência
|
||||
</a>
|
||||
</p>
|
||||
<div className="space-y-2">
|
||||
<p className="text-center text-[14px] text-[#7D7D7D] dark:text-gray-400">
|
||||
Cliente novo?{' '}
|
||||
<Link
|
||||
href="/cliente/cadastro"
|
||||
className="font-medium hover:opacity-80 transition-opacity"
|
||||
style={{ color: 'var(--brand-color)' }}
|
||||
>
|
||||
Cadastre-se aqui
|
||||
</Link>
|
||||
</p>
|
||||
<p className="text-center text-[14px] text-[#7D7D7D] dark:text-gray-400">
|
||||
Agência?{' '}
|
||||
<a
|
||||
href="http://dash.localhost/cadastro"
|
||||
className="font-medium hover:opacity-80 transition-opacity"
|
||||
style={{ color: 'var(--brand-color)' }}
|
||||
>
|
||||
Cadastre sua agência
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
</form>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user