Fix destructure error.

This commit is contained in:
Mike Cao committed 2022-11-18 03:20:45 -08:00
1 parent 592c3fa6e6
commit bba8876522
1 file changed
+2 -5
+2 -5
View File
@@ -12,17 +12,14 @@ export default function useRequireLogin() {
async function loadUser() {
setLoading(true);
const {
ok,
data: { user },
} = await get('/auth/verify');
const { ok, data } = await get('/auth/verify');
if (!ok) {
await router.push('/login');
return null;
}
setUser(user);
setUser(data.user);
setLoading(false);
}