Add redirect functionality after login (#76)

Gone is the frustration of scanning a qr code to only be sent to the homepage
This commit is contained in:
Harrison Conlin
2024-06-29 23:02:23 +10:00
committed by GitHub
parent fff0f4344c
commit 6a1ffd7700
2 changed files with 6 additions and 1 deletions

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;
}