© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago•
20 replies
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')
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...
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Support Request: Auth Database Cleanup Required
SupabaseSSupabase / help-and-questions
3mo ago
Request failed for auth after subscribing
SupabaseSSupabase / help-and-questions
13mo ago
Help with auth - 'Request failed' Error on auth.signIn() from VSCode
SupabaseSSupabase / help-and-questions
4y ago
Request for Improved Response Status in supabase.auth
SupabaseSSupabase / help-and-questions
3y ago