auth-js
auth-js copied to clipboard
`Authorization: Bearer` wrong key for PATCH with Cypress
Bug report
Describe the bug
This is a bit of a weird bug that I am encountering after upgrading supabase-js
from 1.27.0 to 1.31.1.
I am not sure if I am able to reproduce this, so let me try to explain instead.
I have a set of Cypress tests running on my supabase front-end, and after upgrading SupabaseJS, they started failing. Tests are failing because any PATCH-calls are receiving a 404 from the backend.
By inspecting the network calls in Cypress, I can see that there is something weird with the Authorization
-header: It is using the API-token instead of the Access/refresh token!
Consider the Authorization
-header for the successful GET-call:
and compare it to the failing PATCH-call:
Running the exact same operation through the browser (Firefox in this case):
Some further details:
- only PATCH-calls are failing with 404, not GET
- the PATCH calls are only failing in Cypress. When I run through the same steps manually in a browser, it works as expected
- This started only after upgrading supabase-js from 1.27.0 to 1.31.1
Any idea if this is something I'm doing wrong? Or maybe it's not an issue with Supabase but with Cypress? Any hints or pointers would be greatly appreciated!
System information
- OS: Linux 5.13.19-2
- Version of supabase-js: 1.31.1
- Version of Node.js: 16.13.0
EDIT: I have narrowed down the problem to the change in supabase-js
from 1.27.0
to 1.28.0
: https://github.com/supabase/supabase-js/compare/v1.27.0...v1.28.0
Did you find any solutions to this? I'm having the same problem and downgrading doesn't do it for me..
Did you find any solutions to this? I'm having the same problem and downgrading doesn't do it for me..
Unfortunately no, and I am still unable to upgrade past 1.27.0
We are experiencing a similar issue.
EDIT - This looks like our issue: https://github.com/supabase/supabase/discussions/6080
EDIT: I have narrowed down the problem to the change in supabase-js from 1.27.0 to 1.28.0: https://github.com/supabase/supabase-js/compare/v1.27.0...v1.28.0
@kangmingtay FYI, seems there was a regression in gotrue-js ^
Hey everyone, just checking, is this still an issue if you update to the latest supabase/js verison?
I haven't had this issue for a long time now, so my gut feeling would be that this have been resolved by the new versions. 👍