auth-js
auth-js copied to clipboard
auth signIn function no response data
Bug report
Describe the bug
Facing error during supabase.auth.signIn() call
const { error, user } = await supabase.auth.signIn({ email, password })
The above piece of code logs as null _Unexpected token o in JSON at position 1_
To Reproduce
import AsyncStorage from '@react-native-async-storage/async-storage';
const supabaseUrl = 'https://<OMMITED>.supabase.co'
const supabaseAnonKey = '<OMMITTED>'
export const supabase = createClient(supabaseUrl, supabaseAnonKey, {
localStorage: AsyncStorage as any,
autoRefreshToken: true,
persistSession: true,
detectSessionInUrl: false,
});
async function signInWithEmail() {
const { error, user } = await supabase.auth.signIn({ email, password })
if (error) Alert.alert(error.message)
console.log( user, error?.message)
}
Encountered on EXPO (react-native) app.
Expected behavior
user variable supposed to contain user object, else error supposed to contain a message.
Screenshots
System information
- OS: [e.g. macOS, Windows] : Windows 10 64bit
- Browser (if applies) [e.g. chrome, safari] : Physical Android Device with React Native Debugger
- Version of supabase-js: [e.g. 6.0.2] ^1.30.0
- Version of Node.js: [e.g. 10.10.0] v16.4.0
Additional context
Add any other context about the problem here.