promote: dev → uat (GRO-1236 OAuth callback fix) #413
@@ -1 +1 @@
|
|||||||
VITE_API_URL=
|
VITE_API_URL=https://uat.groombook.dev
|
||||||
|
|||||||
@@ -40,7 +40,10 @@ function LoginPage() {
|
|||||||
const handleSocialLogin = async (provider: string) => {
|
const handleSocialLogin = async (provider: string) => {
|
||||||
setIsLoading(true);
|
setIsLoading(true);
|
||||||
setError(null);
|
setError(null);
|
||||||
const result = await signIn.social({ provider, callbackURL: window.location.origin });
|
// Use /admin as callback URL so Better-Auth redirects to the app's dashboard
|
||||||
|
// after the OAuth callback completes, rather than back to /login
|
||||||
|
const callbackURL = `${window.location.origin}/admin`;
|
||||||
|
const result = await signIn.social({ provider, callbackURL });
|
||||||
if (result?.error) {
|
if (result?.error) {
|
||||||
setError(result.error.message ?? "Sign-in failed");
|
setError(result.error.message ?? "Sign-in failed");
|
||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
|
|||||||
Reference in New Issue
Block a user