[dyad] Re-enabled Pocket ID login - wrote 1 file(s)

This commit is contained in:
[dyad]
2026-01-30 10:08:20 +01:00
parent 35685ebe1e
commit 000a8455b3

View File

@@ -5,7 +5,9 @@ import { Auth } from "@supabase/auth-ui-react";
import { ThemeSupa } from "@supabase/auth-ui-shared"; import { ThemeSupa } from "@supabase/auth-ui-shared";
import { useEffect } from "react"; import { useEffect } from "react";
import { useRouter } from "next/navigation"; import { useRouter } from "next/navigation";
import type { AuthChangeEvent, Session } from "@supabase/supabase-js"; import { Button } from "@/components/ui/button";
import { KeyRound } from "lucide-react";
import type { AuthChangeEvent, Session, Provider } from "@supabase/supabase-js";
export default function LoginPage() { export default function LoginPage() {
const router = useRouter(); const router = useRouter();
@@ -20,6 +22,12 @@ export default function LoginPage() {
return () => subscription.unsubscribe(); return () => subscription.unsubscribe();
}, [router]); }, [router]);
const handleOidcSignIn = async () => {
await supabase.auth.signInWithOAuth({
provider: 'pocket_id' as Provider,
});
};
return ( return (
<div className="flex items-center justify-center min-h-screen bg-background"> <div className="flex items-center justify-center min-h-screen bg-background">
<div className="w-full max-w-md p-8 space-y-8"> <div className="w-full max-w-md p-8 space-y-8">
@@ -35,6 +43,20 @@ export default function LoginPage() {
view="sign_in" view="sign_in"
showLinks={true} showLinks={true}
/> />
<div className="relative">
<div className="absolute inset-0 flex items-center">
<span className="w-full border-t" />
</div>
<div className="relative flex justify-center text-xs uppercase">
<span className="bg-background px-2 text-muted-foreground">
Or continue with
</span>
</div>
</div>
<Button variant="outline" className="w-full" onClick={handleOidcSignIn}>
<KeyRound className="mr-2 h-4 w-4" />
Sign in with Pocket ID
</Button>
</div> </div>
</div> </div>
); );