-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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(medusa,medusa-cli): Added an invite option to the create user command, and allow seeding publishable api keys #4192
Conversation
🦋 Changeset detectedLatest commit: ee7b024 The changes in this PR will be included in the next version bump. This PR includes changesets to release 12 packages
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 |
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 2 Ignored Deployments
|
/snapshot-this |
/snapshot-this |
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.
LGTM, why did we needed that?
@adrien2p we need this for the new npx command. Basically, we want to create an invite instead of creating a user and allow the user to set their details through the admin |
Makes complete sense, that is a nice addition 🚀 |
/snapshot-this |
🚀 A snapshot release has been made for this PRTest the snapshots by updating your yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add [email protected] yarn add [email protected] yarn add [email protected] yarn add [email protected] yarn add [email protected] yarn add @medusajs/[email protected]
|
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.
LGTM, with a suggestion :)
await userService.create({ id, email }, password) | ||
if (invite) { | ||
const inviteService = container.resolve("inviteService") | ||
await inviteService.create(email, "admin") |
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.
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.
Sames goes for when --invite
is not used
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.
Actually, this is not relevant for when --invite
is passed. We already print a nice one here.
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.
I handled this in the UserService
, let me know if I should move the handling into the command instead.
/snapshot-this |
🚀 A snapshot release has been made for this PRTest the snapshots by updating your yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add [email protected] yarn add @medusajs/[email protected] yarn add [email protected] yarn add [email protected] yarn add [email protected] yarn add [email protected] yarn add [email protected] yarn add [email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected]
|
/snapshot-this |
🚀 A snapshot release has been made for this PRTest the snapshots by updating your yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add [email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add [email protected] yarn add @medusajs/[email protected] yarn add [email protected] yarn add [email protected] yarn add [email protected] yarn add [email protected] yarn add [email protected] yarn add [email protected] yarn add [email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected] yarn add @medusajs/[email protected]
|
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.
LGTM!
Just need tests to pass 💪 |
…mmand, and allow seeding publishable api keys (#4192) * feat(medusa,medusa-cli): Added an invite option to the create user command * ensure process exits for invites * addressed PR comments * allow seeding publishable api keys
What
--invite
option to themedusa user
command that creates an invite instead of a new user.Why
This is useful for the npx/onboarding flow
Testing
User Command
You can test the command by passing the
--invite
option without a password:Or to avoid having to use the dev-cli tool, you can try using NPX and the snapshot:
Seed command
yarn build
medusa-dev
data/seed.json
the following:yarn seed
in the Medusa backend directory. => No errors should occur.