Skip to content

Commit 5f022cc

Browse files
Redirect to localhost instead of e2b.dev after sign in with oauth in dev environment (e2b-dev#499)
this pr fixes the following in a local development environment: - supabase auth redirect after oauth sign in - forgot password flow this is accomplished by adding a new environment variable `NEXT_PUBLIC_BASE_URL` which prevents checking something like `process.env.NODE_ENV` and conditionally hardcoding the urls in the code itself. this way, for potential changes to these values, we can utilise this mechanic in other places where it may be required in the near future without traversing the codebase manually. i already set `NEXT_PUBLIC_BASE_URL` in the vercel production environment to: `https://e2b.dev`
2 parents 4537e2a + 145a564 commit 5f022cc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

apps/web/src/components/AuthForm.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ function AuthForm({ view }: Props) {
7272
}}
7373
redirectTo={
7474
view === 'forgotten_password'
75-
? 'https://e2b.dev/auth/update-password'
76-
: 'https://e2b.dev/dashboard'
75+
? `${document.location.origin}/auth/update-password`
76+
: `${document.location.origin}/dashboard`
7777
}
7878
/>
7979
</div>

0 commit comments

Comments
 (0)