aboutsummaryrefslogtreecommitdiff
path: root/apps/web/app/(auth)
diff options
context:
space:
mode:
authorSaatvik Arya <[email protected]>2024-07-23 10:55:41 -0700
committerSaatvik Arya <[email protected]>2024-07-23 10:55:41 -0700
commit5fbb0cc88e1c73cab83e880ebd6071268d9a5bd0 (patch)
tree1b11cd1824cf7be82fbfe5645d80dac876de32de /apps/web/app/(auth)
parentadd hasOnboarding to db (diff)
downloadsupermemory-5fbb0cc88e1c73cab83e880ebd6071268d9a5bd0.tar.xz
supermemory-5fbb0cc88e1c73cab83e880ebd6071268d9a5bd0.zip
use hasOnboarded from user table instead of query param
Diffstat (limited to 'apps/web/app/(auth)')
-rw-r--r--apps/web/app/(auth)/onboarding/page.tsx9
-rw-r--r--apps/web/app/(auth)/signin/page.tsx4
2 files changed, 9 insertions, 4 deletions
diff --git a/apps/web/app/(auth)/onboarding/page.tsx b/apps/web/app/(auth)/onboarding/page.tsx
index c402c560..3ac6507d 100644
--- a/apps/web/app/(auth)/onboarding/page.tsx
+++ b/apps/web/app/(auth)/onboarding/page.tsx
@@ -11,7 +11,7 @@ import { CheckIcon, PlusCircleIcon } from "@heroicons/react/24/outline";
import { motion } from "framer-motion";
import { useEffect, useState } from "react";
import { toast } from "sonner";
-import { createMemory } from "@repo/web/app/actions/doers";
+import { completeOnboarding, createMemory } from "@repo/web/app/actions/doers";
import { useRouter } from "next/navigation";
import Logo from "../../../public/logo.svg";
import Image from "next/image";
@@ -23,8 +23,13 @@ export default function Home() {
const { push } = useRouter();
useEffect(() => {
+ const updateDb = async () => {
+ await completeOnboarding();
+ }
if (currStep > 3) {
- push("/home?q=what%20is%20supermemory");
+ updateDb().then(() => {
+ push("/home?q=what%20is%20supermemory");
+ });
}
}, [currStep]);
diff --git a/apps/web/app/(auth)/signin/page.tsx b/apps/web/app/(auth)/signin/page.tsx
index a31343cd..3b563b90 100644
--- a/apps/web/app/(auth)/signin/page.tsx
+++ b/apps/web/app/(auth)/signin/page.tsx
@@ -18,7 +18,7 @@ async function Signin({
const user = await auth();
if (user) {
- await redirect("/home");
+ redirect("/home");
}
return (
@@ -64,7 +64,7 @@ async function Signin({
action={async () => {
"use server";
await signIn("google", {
- redirectTo: "/home?firstTime=true",
+ redirectTo: "/home",
});
}}
>