supabase icon indicating copy to clipboard operation
supabase copied to clipboard

Problem with setSession callback

Open Pierre-Saigot opened this issue 9 months ago • 0 comments

I'm having a problem with the setSession function in Supabase. I have a function intended to return the new session after its creation, but the setSession method seems to return nothing. When I call my function with my "then" no callback is made in the "data", nor in the "error", Here is the corresponding code snippet:

export const supaSetSession = async (access_token, refresh_token) => {
    const supabase = useSupabaseClient()

    const { data, error } = await supabase.auth.setSession({
        access_token,
        refresh_token
    })

    return { data, error }
}

Pierre-Saigot avatar Nov 22 '23 17:11 Pierre-Saigot