supabase-community / auth-ui

Pre-built Auth UI for React
https://supabase.com/docs/guides/auth/auth-helpers/auth-ui
MIT License
487 stars 121 forks source link

supabaseClient.auth.signIn is not a function #26

Closed phongplus closed 2 years ago

phongplus commented 2 years ago

Supabase client

import { createClient } from '@supabase/supabase-js';

const supabaseUrl = `${process.env.NEXT_PUBLIC_SUPABASE_URL}`;
const supabaseAnonKey = `${process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY}`;

export const supabase = createClient(supabaseUrl, supabaseAnonKey);
const handleLogin = async () => {
    const { error: signInError } = await supabaseClient.auth?.signIn(
      {
        email: 'demo@gmail.com',
        password: '123456789'
      },
      { redirectTo: '/' }
    );
    console.log(signInError);
  };

dependencies

"next": "12.2.5",
    "react": "18.2.0",
    "react-dom": "18.2.0"
 "@supabase/supabase-js": "^2.0.0-rc.6",
    "@supabase/ui": "^0.36.5",

is supabase support react 18 ?