mirror of
https://github.com/hay-kot/homebox.git
synced 2025-07-04 09:38:36 +00:00
feat: add log statements + remove auto redirect (#671)
This commit is contained in:
parent
85c8e47016
commit
3ee150e7d6
3 changed files with 3 additions and 3 deletions
|
@ -4,6 +4,7 @@ export default defineNuxtRouteMiddleware(async () => {
|
|||
|
||||
if (!ctx.isAuthorized()) {
|
||||
if (window.location.pathname !== "/") {
|
||||
console.debug("[middleware/auth] isAuthorized returned false, redirecting to /");
|
||||
return navigateTo("/");
|
||||
}
|
||||
}
|
||||
|
@ -13,6 +14,7 @@ export default defineNuxtRouteMiddleware(async () => {
|
|||
const { data, error } = await api.user.self();
|
||||
if (error) {
|
||||
if (window.location.pathname !== "/") {
|
||||
console.debug("[middleware/user] user is null and fetch failed, redirecting to /");
|
||||
return navigateTo("/");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue