adrien2p / medusa-plugins

A collection of awesome plugins for medusa :rocket:
https://medusa-plugins.vercel.app
MIT License
157 stars 46 forks source link

feat: add support for strict options #84

Closed adrien2p closed 1 year ago

adrien2p commented 1 year ago

What

Add support for strict options

When strict is set to all, then both admin and store domains will be strict. When set to admin is enabled, then admin domain will be strict. When set tostore is enabled, then store domain will be strict.

vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
medusa-plugins ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 23, 2023 1:32pm
pevey commented 1 year ago

To avoid possible confusion, might it be better to have one config option ("strict") that could be set to "admin", "store", or "both" (or "all" or something else to that effect)?

adrien2p commented 1 year ago

👌 nice suggestion, i ll take it

adrien2p commented 1 year ago

@pevey what do you think of the last commit?

pevey commented 1 year ago

@adrien2p , I neglected to include "none" in my comment above. I think the type in packages/medusa-plugin-auth/src/types/index.ts should also include an option to disable strict for both, e.g.,:

strict?: 'admin' | 'store' | 'all' | 'none';

adrien2p commented 1 year ago

Ahah my bad, i wanted to add it and completely forgot. none would just be part of the possible values but nothing to change in the code. Thanks 🎉

adrien2p commented 1 year ago

I just need to update the doc and yes it will get out soon 🔥

adrien2p commented 1 year ago

I think we should be good @pevey would you like to review it? Only few tests left to do

adrien2p commented 1 year ago

@quang-ng would you like to review the pr before I release please

pevey commented 1 year ago

I will forego reviewing since I'm not yet familiar enough with the workings of the plugin. I plan to implement in a project over the next week. For now, I will do a yolo and say LGTM!

quang-ng commented 1 year ago

@quang-ng would you like to review the pr before I release please

LGTM @adrien2p I lack the authorization to give my approval for it on Github.