feat: add auto redirection in verify-email page
This commit is contained in:
parent
2c670ebc6a
commit
84aa1f95fe
1 changed files with 6 additions and 0 deletions
|
@ -15,6 +15,12 @@ const token = useRoute().query.token;
|
||||||
try {
|
try {
|
||||||
const res = await fetchWithApi("/auth/verify-email", { query: { token } });
|
const res = await fetchWithApi("/auth/verify-email", { query: { token } });
|
||||||
console.log("hi");
|
console.log("hi");
|
||||||
|
const query = useRoute().query;
|
||||||
|
if (query.redirect_to) {
|
||||||
|
await navigateTo(`/?redirect_to=${query.redirect_to}`);
|
||||||
|
} else {
|
||||||
|
await navigateTo("/");
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Error verifying email:", error);
|
console.error("Error verifying email:", error);
|
||||||
errorMessage.value = error;
|
errorMessage.value = error;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue