auth-js icon indicating copy to clipboard operation
auth-js copied to clipboard

auth signIn function no response data

Open BattleOfPlassey opened this issue 4 years ago • 0 comments

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

1

2

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.

BattleOfPlassey avatar Feb 09 '22 20:02 BattleOfPlassey