Skip to content
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

Merged
merged 4 commits into from
Mar 5, 2018
Merged

Cognito cookie storage #398

merged 4 commits into from
Mar 5, 2018

Conversation

buggy
Copy link
Contributor

@buggy buggy commented Mar 2, 2018

Issue #, if available:

#179

Description of changes:

Add a new option cookieStorage to the manual setup for Auth. This parameter is the params passed to CognitoUserPool and CognitoUser 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-js

By 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.

@codecov-io
Copy link

codecov-io commented Mar 2, 2018

Codecov Report

Merging #398 into master will increase coverage by 0.04%.
The diff coverage is 100%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
packages/aws-amplify/src/Auth/Auth.ts 90.78% <100%> (+0.22%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b5754aa...182e337. Read the comment docs.

@@ -1,3 +1,5 @@
import { CookieStorage } from "amazon-cognito-identity-js";

Copy link
Contributor

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';
Copy link
Contributor

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

Copy link
Contributor

@powerful23 powerful23 left a 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.

@buggy
Copy link
Contributor Author

buggy commented Mar 3, 2018

@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.

Copy link
Contributor

@powerful23 powerful23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Good job! Thanks!

@powerful23 powerful23 merged commit 7cb6195 into aws-amplify:master Mar 5, 2018
@buggy buggy deleted the feature/cognito-cookie-storage branch June 14, 2018 06:20
@github-actions
Copy link

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 *-help channels or Discussions for those types of questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants