diff --git a/web/lib/util/signup.ts b/web/lib/util/signup.ts
index 8dfdbe0a..7bffe923 100644
--- a/web/lib/util/signup.ts
+++ b/web/lib/util/signup.ts
@@ -5,11 +5,12 @@ import { getProfileRow } from 'common/love/profile'
export const signupThenMaybeRedirectToSignup = async () => {
const creds = await firebaseLogin()
- await Router.push('/')
const userId = creds?.user.uid
if (userId) {
const profile = await getProfileRow(userId, db)
- if (!profile) {
+ if (profile) {
+ await Router.push('/')
+ } else {
await Router.push('/signup')
}
}
diff --git a/web/pages/register.tsx b/web/pages/register.tsx
index 9d8ec9fb..095f326d 100644
--- a/web/pages/register.tsx
+++ b/web/pages/register.tsx
@@ -44,8 +44,10 @@ function RegisterComponent() {
if (user) {
const profile = await getProfileRow(user.id, db)
if (profile) {
+ console.log("Router.push('/')")
await Router.push('/')
} else {
+ console.log("Router.push('/signup')")
await Router.push('/signup')
}
setIsLoading(false);
diff --git a/web/pages/signup.tsx b/web/pages/signup.tsx
index aeebb89a..45973f01 100644
--- a/web/pages/signup.tsx
+++ b/web/pages/signup.tsx
@@ -84,13 +84,14 @@ export default function SignupPage() {
}
if (user === null && !holdLoading) {
- router.push('/')
+ console.log('user === null && !holdLoading')
+ return