rp
08/13/2021, 10:47 AMZeferiniX
08/13/2021, 10:47 AMZeferiniX
08/13/2021, 10:47 AMZeferiniX
08/13/2021, 11:01 AMrp
08/13/2021, 11:03 AMZeferiniX
08/13/2021, 11:05 AMZeferiniX
08/13/2021, 11:05 AMZeferiniX
08/13/2021, 11:06 AMrp
08/13/2021, 11:06 AMrp
08/13/2021, 11:06 AMZeferiniX
08/13/2021, 11:10 AMrp
08/14/2021, 9:57 AMZoomeez
08/16/2021, 3:16 PMrp
08/16/2021, 3:17 PMuserguy
08/17/2021, 4:07 PM/refresh
requests, the browser will continue to call the endpoint in an infinite loop until it receives a response. Is this behavior configurable at all? I would think that successive requests to /refresh
should at least wait for the first to resolve, no?
2) In looking at the code, I've also noticed that the default behavior for the 'supertokens-website' SDK is to override the native fetch method on the window object so you can automatically have auth headers/refresh functionality baked into every request to the configured api domain. While I can understand why you went that route, I think it's a generally unfavorable precedent to set, and I don't like the idea of foreign javascript rewriting native methods on the window (particularly something as sensitive as fetch)... Since you already offer axios interceptors, is there a way to disable the native fetch overwrite behavior if I don't want to opt in?rp
08/17/2021, 4:12 PMsupertokens.init({
apiDomain: "...",
override: {
functions: (oI) => {
return {
...oI,
addFetchInterceptorsAndReturnModifiedFetch: (originalFetch, config) => {
return originalFetch;
}
}
}
},
});
rp
08/17/2021, 4:16 PMrp
08/17/2021, 4:17 PMuserguy
08/17/2021, 4:24 PMuserguy
08/17/2021, 4:36 PM/refresh
was getting back a 200
from my server, but the response payload/headers obviously didn't have any tokens or useful auth information included. This is what was causing the infinite loop, and I can repro it pretty easily just by configuring my server to res.status(200).send('ok')
on the endpointuserguy
08/17/2021, 4:37 PMrp
08/17/2021, 4:38 PMuserguy
08/17/2021, 4:38 PMuserguy
08/17/2021, 6:58 PM/auth
route. What ends up happening is that for some reason, when I browse to /auth
, I get redirected to the homepage. My configuration is the same as what's in the supertokens documentation online. Out of curiosity, is NextJS11 a known incompatibility?supertokens-auth-react
userguy
08/18/2021, 4:07 PMsupertokens-website
package with fetch interceptors active, if I make a request against an express backend that's configured with supertokens-node
using the Session
recipe and both the Session.verifySession({ sessionRequired: false })
and supertokens.errorHandler()
middleware(s) for a given route, I (when applicable) get back a 401
from the server with a message "try refresh token". At this point however, nothing happens in the front-end. Should the fetch interceptor be auto-trying to refresh the token here or is this something I need to manually handle?mcleoandpboy
08/18/2021, 4:12 PMrp
08/18/2021, 8:26 PMaxios
, then make sure that you have added the interceptor to it.userguy
08/18/2021, 8:27 PMrp
08/18/2021, 8:28 PMrp
08/18/2021, 8:29 PMrid
?rp
08/18/2021, 8:29 PMrid
?