Merge branch 'main' into negate-labels

This commit is contained in:
zebrapurring
2024-06-29 18:05:35 +02:00
committed by GitHub
3 changed files with 10 additions and 1 deletions

View File

@@ -6,6 +6,10 @@
text-transform: none !important;
}
.tooltip {
overflow-wrap: break-word;
}
/* transparent subtle scrollbar */
::-webkit-scrollbar {
width: 0.2em;

View File

@@ -1,10 +1,12 @@
export default defineNuxtRouteMiddleware(async () => {
const ctx = useAuthContext();
const api = useUserApi();
const redirectTo = useState("authRedirect");
if (!ctx.isAuthorized()) {
if (window.location.pathname !== "/") {
console.debug("[middleware/auth] isAuthorized returned false, redirecting to /");
redirectTo.value = window.location.pathname;
return navigateTo("/");
}
}
@@ -15,6 +17,7 @@ export default defineNuxtRouteMiddleware(async () => {
if (error) {
if (window.location.pathname !== "/") {
console.debug("[middleware/user] user is null and fetch failed, redirecting to /");
redirectTo.value = window.location.pathname;
return navigateTo("/");
}
}

View File

@@ -103,6 +103,7 @@
const loading = ref(false);
const loginPassword = ref("");
const redirectTo = useState("authRedirect");
async function login() {
loading.value = true;
@@ -116,7 +117,8 @@
toast.success("Logged in successfully");
navigateTo("/home");
navigateTo(redirectTo.value || "/home");
redirectTo.value = null;
loading.value = false;
}