Open YA9 opened 5 months ago
I found a fix for this. It doesn't make sense why this works, but
supabase.auth
.signOut({ scope: 'local' })
putting scope local, instead of leaving it empty worked. Seems like there's an error with scope global
There's still another issue relating to this. When upgrading to the latest version: 2.43.5, everything breaks and I get this error:
On version 2.43.2, I don't get this error, and things work fine in production.
Having the same issue, I faced both the issue mentioned here.
I found a solution to the issue. Check your build configuration steps. In my case, I was using Vite.js, which had a global: 'window'
transformation configuration. Commenting out that line prevents the global
keyword from being transformed into window
.
The Supabase-JS client code uses a global
object. However, during the Vite.js build, this was being converted to window
. In the browser, the window
object refers to the document object, which does not contain the global
values, leading to the breakage.
Here's the updated configuration:
export default defineConfig({
define: {
// global: 'window',
},
// other configurations
});
This change resolved the issue for me. If you need further assistance, feel free to ask!
Bug report
Describe the bug
When I try supabase.auth.signOut(), on version 2.43.3 on JS, I get this error: { "code": 400, "error_code": "validation_failed", "msg": "Unsupported logout scope "window"" }
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
System information