mobile update

This commit is contained in:
arrelin
2026-03-10 14:28:24 +03:00
parent 45eefeb1f5
commit 1832997ebe
5 changed files with 134 additions and 84 deletions

View File

@@ -26,8 +26,14 @@ export default function Login() {
const url = Array.isArray(urls) ? urls[0] : urls;
if (!url.startsWith(DEEP_LINK_SCHEME)) return;
const token = new URL(url).searchParams.get('token');
if (!token) return;
let token: string | null;
try {
token = new URL(url).searchParams.get('token');
} catch {
setError(t('login.error'));
return;
}
if (!token) { setError(t('login.error')); return; }
try {
setLoading(true);
@@ -35,7 +41,7 @@ export default function Login() {
const me = await authApi.me();
setUser(me.data);
} catch {
setError(t('login.authError'));
setError(t('login.error'));
setLoading(false);
}
});