Next.js Discord

Discord Forum

Supabase server client OAuth methods not working

American Pipit posted this in #help-forum
Open in Discord
American PipitOP
export const signUpWithGoogle = async () => {
    'use server';
    const cookieStore = cookies();

    const serverSupabase = createServerClient<Database>(
            cookies: {
                get(name: string) {
                    return cookieStore.get(name)?.value;
                set(name: string, value: string, options: CookieOptions) {
                    cookieStore.set({ name, value, ...options });
                remove(name: string, options: CookieOptions) {
                    cookieStore.delete({ name, ...options });

    const {data, error} = await serverSupabase.auth.signInWithOAuth({
        provider: 'google',
        options: { redirectTo: `${getURL()}/auth/callback` },

this is my server action, most of the other auth stuff is from the supabase docs. When I log data, it shows {url: someUrl, provider: google}, and when I manually go to that URL, it's actually the google sign in the function should redirect the user to.

0 Replies