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

Added domain option to session #4951

Merged
merged 8 commits into from
Feb 28, 2021
Merged

Conversation

zoeyfrisart
Copy link
Contributor

This adds the option for users to specify a domain for the session that is then used in the cookie.

Use case of this feature

We ran into an issue where we had keystone running at api.domain.com, this caused the cookie domain to be set to api.domain.com.
We then had a use case for the cookie at example.domain.com, however this domain doesn't have access to the cookie.

Allowing the user to set the domain allows them to set it to: domain.com

This would also solve #4674 for keystone-next

@vercel
Copy link

vercel bot commented Feb 25, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/keystonejs/keystone-next-docs/AHwgm6GqKmtY9tAfyCrcre7Rs3qW
✅ Preview: https://keystone-next-docs-git-fork-yannick1691-master-keystonejs.vercel.app

@vercel vercel bot temporarily deployed to Preview February 25, 2021 14:19 Inactive
Copy link
Contributor

@timleslie timleslie left a comment

Choose a reason for hiding this comment

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

Hi @yannick1691, thanks for the PR. I think this is a helpful change. To get it through could I get you to address the linting issues. I suspect it just needs trailing commas after domain, or you can run yarn format.

Also, could you please update the docs in docs-next/pages/api/session.mdx to include this option.

Thanks!

@changeset-bot
Copy link

changeset-bot bot commented Feb 26, 2021

🦋 Changeset detected

Latest commit: f8236ed

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 8 packages
Name Type
@keystone-next/keystone Minor
@keystonejs/test-utils Patch
@keystone-next/auth Major
@keystone-next/example-auth Patch
@keystone-next/app-basic Patch
@keystone-next/example-ecommerce Patch
@keystone-next/example-roles Patch
@keystone-next/example-todo Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel vercel bot temporarily deployed to Preview February 26, 2021 08:55 Inactive
@vercel vercel bot temporarily deployed to Preview February 26, 2021 08:58 Inactive
@zoeyfrisart
Copy link
Contributor Author

Hi @yannick1691, thanks for the PR. I think this is a helpful change. To get it through could I get you to address the linting issues. I suspect it just needs trailing commas after domain, or you can run yarn format.

Also, could you please update the docs in docs-next/pages/api/session.mdx to include this option.

Thanks!

Hi @timleslie , thank you for the fast response. I have implemented the suggested changes and have updated the documentation. For the documentation I looked at the MDN specs of the domain property. I also link to the MDN page, but still mentioned some of the key parts of the domain property so that users don't miss those. https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#attributes

@vercel vercel bot temporarily deployed to Preview February 28, 2021 21:43 Inactive
@vercel vercel bot temporarily deployed to Preview February 28, 2021 22:08 Inactive
Copy link
Contributor

@timleslie timleslie left a comment

Choose a reason for hiding this comment

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

This looks great, thanks @yannick1691 🙏

@timleslie timleslie enabled auto-merge (squash) February 28, 2021 22:09
@vercel vercel bot temporarily deployed to Preview February 28, 2021 22:12 Inactive
@timleslie timleslie merged commit 880fd5f into keystonejs:master Feb 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants