Error message assumes the Storage provider for amazon-cognito-identity.js is "LocalStorage"
See original GitHub issueBefore opening, please confirm:
- I have searched for duplicate or closed issues and discussions.
- I have read the guide for submitting bug reports.
- I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
JavaScript Framework
Not applicable
Amplify APIs
Not applicable
Amplify Categories
No response
Environment information
# Put output below this line
Describe the bug
CognitoUser.js#L1444 (in the getSession
function) assumes that one is using the default window.LocalStorage
instead of a (supported) override configured via the Storage
key.
The code is
new Error('Local storage is missing an ID Token, Please authenticate'),
It might be more generically correct for the code to be
new Error('Storage is missing an ID Token, Please authenticate'),
allowing for the case where the app chooses to override the default LocalStorage
in favor of a different approach.
Expected behavior
new Error('Storage is missing an ID Token, Please authenticate'),
Reproduction steps
Call cognitoUser.signOut(revokeCallback);
without an ID Token in Storage. The revokeCallback
function is called back with an error
arg which contains the “overspecified” text in question:
'Local storage is missing an ID Token, Please authenticate'
Code Snippet
// Put your code below this line.
new Error('Local storage is missing an ID Token, Please authenticate'),
Log output
// Put your logs below this line
aws-exports.js
No response
Manual configuration
No response
Additional configuration
No response
Mobile Device
No response
Mobile Operating System
No response
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
No response
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
localStorage usage should be optional · Issue #87 - GitHub
CognitoUser.signOut(). make it obvious that getCurrentUser() is referring to a persistant store; provide support for altenative storage ...
Read more >Local storage is missing an ID Token, Please authenticate
Getting Local storage is missing an ID Token, Please authenticate. My end goal is to get the user signed up through AWS Cognito...
Read more >amazon-cognito-identity-js - npm
Amazon Cognito Identity Provider JavaScript SDK. ... onSuccess will be called immediately (assuming there is no error). cognitoUser.
Read more >Amazon Cognito authentication issues with OpenSearch ...
This error message occurs when Amazon Cognito doesn't have the proper permissions to assume an IAM role on behalf of the authenticated user....
Read more >amazon-cognito-identity-js | Yarn - Package Manager
Fast, reliable, and secure dependency management.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hey @chrisbonifacio, I’m inexperienced at Pull Requests. I tried to do it better this time. Hope I got it! If not, please let me know.
Happy to!