-
-
Notifications
You must be signed in to change notification settings - Fork 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
feat(core): Enable to change the name of the cookie for Admin API #2482
feat(core): Enable to change the name of the cookie for Admin API #2482
Conversation
The new APIs require standalone components.
Co-authored-by: Alessio Marano <[email protected]>
…endure-ecommerce#2454) Fixes vendure-ecommerce#2450 Co-authored-by: Balázs Gallay <[email protected]>
…s are insufficient (vendure-ecommerce#2460) Fixes vendure-ecommerce#2456
✅ Deploy Preview for effervescent-donut-4977b2 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
I have a deep-seated aversion to adding new config properties to the Vendure config object. So here's another suggestion: what if we change the type of the existing {
name: string | { shop: string; admin: string; }
} Internally the implementation could be similar, but just check the type of this property. |
… an object for Admin/Shop
Done in I tested locally using the GraphQL Playgrounds and it seems to work as expected 😊 |
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.
Thanks, it looks good. I just suggested a small refactor to avoid duplication in the testing package and make maintenance easier.
Also I think this should go on the minor
branch because it's a new API being added.
Thank you! |
Hello @michaelbromley (and happy new year, it's allowed since we are still in January 🎉!), Do you have an estimated release date of the future |
Hi, |
Is this feature released? or is it still pending? |
final release of v2.2 will be next week |
Issue
Fixes #2481
Description
In this PR, I added a new
authOptions.adminCookieName
optional parameter in the Vendure config.It makes it possible to give a custom name to the token set for the Admin API than the one given to the Shop API.
For now, here is the cookie naming behavior:
authOptions.cookieOptions.name
parameter:'session'
authOptions.cookieOptions.name
parameter to something like'cookie-name'
:'cookie-name'
There is currently no way to give a custom name to the Admin API cookies, different from the Shop API ones.
With this changes, we can therefore set different cookies names for both APIs.
How to test
dev-config.ts
, change theauthOptions
as follows to name Shop API cookiesshop-api
andshop-api.sign
, and the Admin API cookiesadmin-api
andadmin-api.sig
:dev-server
/admin-api
and authenticate/shop-api
and authenticate