redirect to pricing back
This commit is contained in:
parent
3949859398
commit
94c271d07e
@ -5,6 +5,7 @@
|
||||
import toast from "svelte-french-toast";
|
||||
import Input from "$lib/components/Input.svelte";
|
||||
import { screenWidth } from "$lib/store";
|
||||
import { page } from "$app/stores";
|
||||
|
||||
export let form;
|
||||
|
||||
@ -17,20 +18,6 @@
|
||||
return async ({ result, update }) => {
|
||||
switch (result.type) {
|
||||
case "success":
|
||||
if (form?.notVerified) {
|
||||
toast.error("Please verify your email first", {
|
||||
style: "border-radius: 200px; background: #333; color: #fff;",
|
||||
});
|
||||
await update();
|
||||
break;
|
||||
} else form?.notVerified === false;
|
||||
{
|
||||
toast.success("Login successfully!", {
|
||||
style: "border-radius: 200px; background: #333; color: #fff;",
|
||||
});
|
||||
await update();
|
||||
break;
|
||||
}
|
||||
case "redirect":
|
||||
isClicked = true;
|
||||
toast.success("Login successfully!", {
|
||||
@ -53,17 +40,18 @@
|
||||
await update();
|
||||
}
|
||||
|
||||
/*
|
||||
setTimeout(() => {
|
||||
if (result.type === 'redirect') {
|
||||
const anchor = document.createElement('a');
|
||||
anchor.href = '/';
|
||||
anchor.dataset.sveltekitReload = true;
|
||||
document.body.appendChild(anchor);
|
||||
anchor.dispatchEvent(new MouseEvent('click'));
|
||||
}
|
||||
}, 280);
|
||||
*/
|
||||
setTimeout(() => {
|
||||
if (
|
||||
["redirect", "success"]?.includes(result.type) &&
|
||||
$page?.url?.pathname === "/pricing"
|
||||
) {
|
||||
const anchor = document.createElement("a");
|
||||
anchor.href = "/pricing";
|
||||
anchor.dataset.sveltekitReload = true;
|
||||
document.body.appendChild(anchor);
|
||||
anchor.dispatchEvent(new MouseEvent("click"));
|
||||
}
|
||||
}, 280);
|
||||
|
||||
loading = false;
|
||||
};
|
||||
@ -74,6 +62,7 @@
|
||||
return async ({ result, update }) => {
|
||||
switch (result.type) {
|
||||
case "success":
|
||||
case "redirect":
|
||||
isClicked = true;
|
||||
toast.success("Registration successfully!", {
|
||||
style: "border-radius: 200px; background: #333; color: #fff;",
|
||||
@ -94,6 +83,20 @@
|
||||
default:
|
||||
await update();
|
||||
}
|
||||
|
||||
setTimeout(() => {
|
||||
if (
|
||||
["redirect", "success"]?.includes(result.type) &&
|
||||
$page?.url?.pathname === "/pricing"
|
||||
) {
|
||||
const anchor = document.createElement("a");
|
||||
anchor.href = "/pricing";
|
||||
anchor.dataset.sveltekitReload = true;
|
||||
document.body.appendChild(anchor);
|
||||
anchor.dispatchEvent(new MouseEvent("click"));
|
||||
}
|
||||
}, 280);
|
||||
|
||||
loading = false;
|
||||
};
|
||||
};
|
||||
@ -209,7 +212,7 @@ const output = await response.json();
|
||||
>
|
||||
<div class="flex flex-row m-auto items-center">
|
||||
<span class="loading loading-infinity"></span>
|
||||
<span class="text-white ml-1.5">Signing Up</span>
|
||||
<span class=" ml-1.5">Signing Up</span>
|
||||
</div>
|
||||
</label>
|
||||
{/if}
|
||||
|
||||
@ -61,7 +61,7 @@ export const actions = {
|
||||
error(err.status, err.message);
|
||||
}
|
||||
|
||||
redirect(302, "/");
|
||||
redirect(302, "/pricing");
|
||||
},
|
||||
|
||||
register: async ({ locals, request }) => {
|
||||
@ -78,7 +78,7 @@ export const actions = {
|
||||
}
|
||||
|
||||
try {
|
||||
let newUser = await locals.pb.collection("users").create(formData);
|
||||
await locals.pb.collection("users").create(formData);
|
||||
/*
|
||||
await locals.pb?.collection('users').update(
|
||||
newUser?.id, {
|
||||
@ -101,7 +101,7 @@ await locals.pb?.collection('users').update(
|
||||
error(err.status, err.message);
|
||||
}
|
||||
|
||||
redirect(303, "/");
|
||||
redirect(302, "/pricing");
|
||||
},
|
||||
|
||||
oauth2: async ({ url, locals, request, cookies }) => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user