fix(auth): Force absolute URL and add error logging
Some checks are pending
Test / backend-test (push) Waiting to run
Test / frontend-test (push) Waiting to run

This commit is contained in:
fullsizemalt 2026-01-06 23:57:36 -08:00
parent f97e8ea1d0
commit fb1e3c05c7

View file

@ -111,14 +111,17 @@ export default function LoginPage() {
(window as any).tapCount = 0;
setIsLoading(true);
try {
const { data } = await api.post('/auth/login', {
// Force absolute URL to bypass potentially broken API client config in native context
const { data } = await api.post('https://veridian.runfoo.run/api/auth/login', {
email: 'tenwest@proton.me',
password: '2GreenSlugs!'
});
login(data.accessToken, data.refreshToken, data.user);
navigate('/dashboard');
} catch (err: any) {
setError('Auto-login failed.');
console.error('Auto-login error:', err);
const details = err.response?.data?.message || err.message;
setError(`Login failed: ${details} (${err.response?.status || 'NoStatus'})`);
setIsLoading(false);
}
}
@ -149,7 +152,7 @@ export default function LoginPage() {
className="p-4 bg-[var(--color-error)]/10 border border-rose-500/20 rounded-xl flex items-start gap-3"
>
<Shield className="text-[var(--color-error)] flex-shrink-0 mt-0.5" size={16} />
<p className="text-sm text-[var(--color-error)] leading-snug">{error}</p>
<p className="text-sm text-[var(--color-error)] leading-snug break-all font-mono text-xs">{error}</p>
</motion.div>
)}
</AnimatePresence>