SupabaseS
Supabase4y ago
Zeph

Cypress auth request

I am trying to make a login request in cypress as follows:
cy.request("POST", 'https://<my_supabase_api_url>.supabase.co/auth/v1/token?grant_type=password&apikey=<My_API_Key>, { email: 'bob@gmail.com', password: '123456' })
    .its('body')
    .as('currentUser')

I can confirm that the api request is correct as I can see the response in Cypress, but when I console.log(useUser()) in one of my components, it is still null.
I would assume that after making the request, the user should be logged in...
Was this page helpful?