Migrate backend from Lovable Cloud to own Supabase (EDU project)
- Point .env + supabase/config.toml at EDU (qgmcpounpkgsjlwosjdi) - Replace Lovable Google-OAuth shim with native supabase.auth.signInWithOAuth - Remove src/integrations/lovable and @lovable.dev/cloud-auth-js dependency - Drop .lovable metadata; gitignore supabase/.temp Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+8
-4
@@ -2,7 +2,6 @@ import { createFileRoute, useNavigate } from "@tanstack/react-router";
|
||||
import { useState } from "react";
|
||||
import { z } from "zod";
|
||||
import { supabase } from "@/integrations/supabase/client";
|
||||
import { lovable } from "@/integrations/lovable";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { Label } from "@/components/ui/label";
|
||||
@@ -51,9 +50,14 @@ function AuthPage() {
|
||||
};
|
||||
|
||||
const onGoogle = async () => {
|
||||
const res = await lovable.auth.signInWithOAuth("google", { redirect_uri: window.location.origin });
|
||||
if (res.error) toast.error(res.error.message ?? "Google sign-in failed");
|
||||
else if (!res.redirected) navigate({ to: "/dashboard" });
|
||||
// Native Supabase OAuth: redirects the browser to Google, then back to
|
||||
// redirectTo. supabase-js (detectSessionInUrl) restores the session on
|
||||
// return, and useAuth's onAuthStateChange picks it up.
|
||||
const { error } = await supabase.auth.signInWithOAuth({
|
||||
provider: "google",
|
||||
options: { redirectTo: `${window.location.origin}/dashboard` },
|
||||
});
|
||||
if (error) toast.error(error.message ?? "Google sign-in failed");
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user