Closed YoniH closed 5 years ago
Try it without specifying the storage type. by default, it will use localStorage if localStorage not available it will automatically use in memory storage. (if you need to understand how it works look at the implemntation of StorageHelper.js )
i. e remove this line Storage: 'LocalStorage'
Tried that already. When I do that, I see nothing in the local storage, even after I am redirected back to my page with id token and access token in the url. That's what made me explicitly specify LocalStorage in the first place
On Sat, 27 Oct 2018, 22:45 Chamath Silva notifications@github.com wrote:
Try it without specifying the storage type. by default, it will use localStorage if localStorage not available it will automatically use in memory storage. (if you need to understand how it works look at the implemntation of StorageHelper.js https://github.com/aws/amazon-cognito-auth-js/blob/master/src/StorageHelper.js )
i. e remove this line Storage: 'LocalStorage'
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/aws/amazon-cognito-auth-js/issues/165#issuecomment-433649908, or mute the thread https://github.com/notifications/unsubscribe-auth/AHVnyLRrLHphL8U73yUspXCa4sY5ZSikks5upLfugaJpZM4X6rwW .
It's ok now, there was something else I missed. Thanks
@YoniH how did you solve this problem, i am facing problem. thank you in advance
When I set Storage: 'LocalStorage', my React page crashes on startup. The error is:
TypeError: this.storage.getItem is not a function CognitoAuth.getLastUser node_modules/amazon-cognito-auth-js/es/CognitoAuth.js:441 438 | CognitoAuth.prototype.getLastUser = function getLastUser() { 439 | var keyPrefix = 'CognitoIdentityServiceProvider.' + this.getClientId(); 440 | var lastUserKey = keyPrefix + '.LastAuthUser';
My code: