aar2dee2
07/19/2022, 11:03 AMts
//import from packages
import React from "react";
import { Auth } from "@supabase/ui";
import { supabaseClient } from "@supabase/auth-helpers-nextjs";
//import from context and utils
//import from components
//import assets
export default function AllLoginOptions() {
return (
<div className="all-login-options">
<Auth
supabaseClient={supabaseClient}
providers={["google"]}
socialLayout="horizontal"
socialButtonSize="large"
className="text-warmwhite"
redirectTo={`app.${process.env.APP_DOMAIN}/dashboard`}
></Auth>
</div>
);
}
I've changed the Site url for auth redirects in my the Supabase Project Authentication settings to my production domain. I've also added localhost to the list of allowed redirect urls. However, when I login in during dev (on localhost), the redirect happens to the production domain after auth. How can I redirect to localhost?
Note: the APP_DOMAIN environment variable is set as localhost in dev, and as the production domain in prod.Needle
07/19/2022, 11:03 AMsilentworks
07/19/2022, 2:03 PM/dashboard when you click the link albeit for the production domain?aar2dee2
07/20/2022, 6:55 AMaar2dee2
07/22/2022, 3:03 PMsilentworks
07/22/2022, 4:53 PMwithPageAuth I'm guessing and that would automatically redirect you back to the login page hence the / redirect. This is because the server-side gets rendered before the client-side and the login state isn't known until the onAuthStateChange runs (which is client side code) and notifies the server-side that you are logged in.aar2dee2
07/29/2022, 11:27 AMwithPageAuth to pick different domains based on whether you're in dev or prodsilentworks
07/29/2022, 11:39 AM