mirror of
https://github.com/BradNut/umami
synced 2025-09-08 17:40:29 +00:00
Fix destructure error.
This commit is contained in:
parent
592c3fa6e6
commit
bba8876522
1 changed files with 2 additions and 5 deletions
|
|
@ -12,17 +12,14 @@ export default function useRequireLogin() {
|
||||||
async function loadUser() {
|
async function loadUser() {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
|
|
||||||
const {
|
const { ok, data } = await get('/auth/verify');
|
||||||
ok,
|
|
||||||
data: { user },
|
|
||||||
} = await get('/auth/verify');
|
|
||||||
|
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
await router.push('/login');
|
await router.push('/login');
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
setUser(user);
|
setUser(data.user);
|
||||||
|
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue