-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Cognito cookie storage #398
Cognito cookie storage #398
Conversation
Codecov Report
@@ Coverage Diff @@
## master #398 +/- ##
==========================================
+ Coverage 89.33% 89.37% +0.04%
==========================================
Files 54 54
Lines 2598 2608 +10
Branches 532 534 +2
==========================================
+ Hits 2321 2331 +10
Misses 266 266
Partials 11 11
Continue to review full report at Codecov.
|
@@ -1,3 +1,5 @@ | |||
import { CookieStorage } from "amazon-cognito-identity-js"; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merge this import to line 143
@@ -22,6 +22,7 @@ import { | |||
} from '../Common'; | |||
import Platform from '../Common/Platform'; | |||
import Cache from '../Cache'; | |||
import { CookieStorage, ICognitoUserPoolData, ICognitoUserData } from 'amazon-cognito-identity-js'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Import these from Object Cognito
like line 33 to 38 does
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@buggy Great job! All looks good except some importing statements if you could modify? Thanks.
@powerful23 I updated the import syntax as suggested however you can't import interfaces that way so I needed to leave those using the more standard syntax. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Good job! Thanks!
This pull request has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs. Looking for a help forum? We recommend joining the Amplify Community Discord server |
Issue #, if available:
#179
Description of changes:
Add a new option
cookieStorage
to the manual setup forAuth
. This parameter is the params passed toCognitoUserPool
andCognitoUser
as described in Use case 26. Using cookies to store cognito tokens on https://github.com/aws/aws-amplify/tree/master/packages/amazon-cognito-identity-jsBy setting this Cognito will store the tokens in a cookie allowing them to be used across subdomains.
If this option is not set then everything will work as is.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.