Skip to content

Commit 4aa0b33

Browse files
authored
Merge pull request #36 from trypear/pan/redirect
No auth button in production feature flag
2 parents 109bcaf + bbb34e4 commit 4aa0b33

File tree

3 files changed

+4
-10
lines changed

3 files changed

+4
-10
lines changed

app/(auth)/signin/page.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ export default async function SignIn() {
66
const supabase = createClient()
77
const { data } = await supabase.auth.getUser()
88

9-
if (process.env.NODE_ENV === 'production') { // Temporarily redirect to home page in production until we have a proper backend auth flow
10-
redirect('/')
11-
}
12-
139
if (data?.user) {
1410
redirect('/')
1511
}

app/(auth)/signup/page.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ import SignUpComponent from "@/components/auth/signup"
55
export default async function SignUp() {
66
const supabase = createClient()
77
const { data } = await supabase.auth.getUser()
8-
9-
if (process.env.NODE_ENV === 'production') { // Temporarily redirect to home page in production until we have a proper backend auth flow
10-
redirect('/')
11-
}
128

139
if (data?.user) {
1410
redirect('/')

middleware.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@ import { updateSession } from "./utils/supabase/middleware"
33

44
export async function middleware(request: NextRequest) {
55
if (
6-
request.nextUrl.pathname.startsWith("/signin") ||
7-
request.nextUrl.pathname.startsWith("/signup")
6+
(request.nextUrl.pathname.startsWith("/signin") ||
7+
request.nextUrl.pathname.startsWith("/signup"))
8+
// FEATURE FLAG
9+
&& process.env.NODE_ENV === "production"
810
) {
911
return NextResponse.redirect(new URL("/", request.url))
1012
}

0 commit comments

Comments
 (0)