Bug report
Describe the bug
When you set the autoRefreshSession: false setting when creating the browser client, the client auto refreshes the token anyways.
i.e.
const client = createBrowserClient<Database>(dbClientConfig.url, dbClientConfig.anonKey, {
auth: {
autoRefreshToken: false,
},
});
console.log(client.auth.autoRefreshToken) # true
This is because in the createBrowserClient code, it will always set this setting as true if it's in the browser.
|
autoRefreshToken: isBrowser(), |
This is misleading, and if this is intentional, the typing interface should reflect that so users can't pass in autoRefreshToken, detectSessionInUrl or persistSession
To Reproduce
Try to create a client using createBrowserClient with autoRefreshToken: false
Print out the result, it's setting for autoRefreshToken will still be true
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
System information
- OS: [e.g. macOS, Windows]
- Browser (if applies) [e.g. chrome, safari]
- Version of supabase-js: [e.g. 6.0.2]
- Version of Node.js: [e.g. 10.10.0]
Additional context
Add any other context about the problem here.
Bug report
Describe the bug
When you set the
autoRefreshSession: falsesetting when creating the browser client, the client auto refreshes the token anyways.i.e.
This is because in the
createBrowserClientcode, it will always set this setting as true if it's in the browser.ssr/src/createBrowserClient.ts
Line 139 in a1b60ba
This is misleading, and if this is intentional, the typing interface should reflect that so users can't pass in
autoRefreshToken,detectSessionInUrlorpersistSessionTo Reproduce
Try to create a client using
createBrowserClientwithautoRefreshToken: falsePrint out the result, it's setting for
autoRefreshTokenwill still be trueExpected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
System information
Additional context
Add any other context about the problem here.