SupabaseS
Supabase12mo ago
patryk

auth-ui-react question

Short question. How could I run fetchUserSession() on <Auth> component successfull sign in? <Auth> doesn't have onSignIn() callback, so do I have to implement my own Auth components?
Thanks!
PS.: I can't use onAuthStateChange, because of a bug
import { Auth } from '@supabase/auth-ui-react'
export default function LoginPage() {

    const { fetchUserSession } = useAuthContext()

    return (
        <div className="min-h-screen bg-white flex items-center justify-center p-4">
            <div className="w-full max-w-md">
                <h1 className="text-2xl font-bold text-center mb-8">Welcome to MedComply</h1>
                <div className="bg-white p-8 rounded-lg shadow-md border border-gray-200">
                    <Auth
                        supabaseClient={supabaseClient}
                        appearance={{ theme: ThemeSupa }}
                        theme="light"
                        providers={[]}
                    />
                </div>
            </div>
        </div>
    );
}
Was this page helpful?