-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
StorageType undefined outside the interceptor? #66
Comments
So, this feels awfully hacky but everything was solved in my case by simply having StorageProxt.Storage default to localStorage rather than StorageProxy.ts import { BrowserStorageService } from './BrowserStorageService'
import { type StorageType } from './StorageType'
type StorageProxyType = {
Storage: StorageType | null
}
export const StorageProxy: StorageProxyType = {
Storage: new BrowserStorageService(window.localStorage),
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm a back-end coder, so go easy on me here, as this may be outright pilot error.
Setting up and using authTokenInterceptor looks to be working just fine, thanks for that - but, when trying to follow the examples in the README, to call e.g. setAuthTokens, isLoggedIn, etc outside the context of the interceptor, it seems like StorageProxy.Storage is just returning
null
, so those calls simply do nothing.What am I missing here? If one calls setAuthTokens such as in the Login/Logout example, where is the storage actually being set?
I'm happy to give more detail or code snips, etc, as needed.
The text was updated successfully, but these errors were encountered: