You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can't determine how to use this transport during the time period when a user has not logged in and there is no authentication token. As observed in #3, the library goes into an infinite loop when the token does not exist or an error is thrown. But even if I return an unresolved Promise to prevent the infinite loop, the transport will not send requests until the token exists.
What I would find useful is a transport that resolves an optional authentication token for each request and allowed me to manage refreshes on my own. Is there another library intended for that use case?
The text was updated successfully, but these errors were encountered:
I briefly considered giving the transport a placeholder JWT and teaching the server to interpret it as an anonymous user, then realized that the caching logic means the placeholder token would remain for some period of time until the next refresh interval noticed the new legitimate token.
Similarly, this caching means that the transport would hold onto a token after the user had logged out. If a device switched accounts, the caching may even mean that new requests could be submitted with the old credentials.
In case anyone else happens through, here's a TypeScript implementation of a transport that simply asks for your current token every time it sends a request:
I can't determine how to use this transport during the time period when a user has not logged in and there is no authentication token. As observed in #3, the library goes into an infinite loop when the token does not exist or an error is thrown. But even if I return an unresolved Promise to prevent the infinite loop, the transport will not send requests until the token exists.
What I would find useful is a transport that resolves an optional authentication token for each request and allowed me to manage refreshes on my own. Is there another library intended for that use case?
The text was updated successfully, but these errors were encountered: