mobile update

This commit is contained in:
arrelin
2026-03-10 14:45:08 +03:00
parent 1832997ebe
commit 035e6b20c7
4 changed files with 33 additions and 7 deletions

View File

@@ -30,18 +30,20 @@ export default function Login() {
try {
token = new URL(url).searchParams.get('token');
} catch {
setError(t('login.error'));
setError(t('login.authError'));
return;
}
if (!token) { setError(t('login.error')); return; }
if (!token) { setError(t('login.authError')); return; }
try {
setLoading(true);
await authApi.mobileCallback(token);
const me = await authApi.me();
setUser(me.data);
} catch {
setError(t('login.error'));
} catch (err: any) {
const status = err?.response?.status;
const msg = err?.response?.data ? JSON.stringify(err.response.data) : err?.message;
setError(`${status ?? 'network'}: ${msg}`);
setLoading(false);
}
});