-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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: Reset password #8962
feat: Reset password #8962
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
6 Skipped Deployments
|
|
adminHeaders | ||
) | ||
).data.invite | ||
describe("Full authentication lifecycle", () => { |
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.
These are existing tests
const signup = await api | ||
.post("/auth/user/emailpass/register", { | ||
email: "admin@medusa.js", | ||
describe("Reset password flows", () => { |
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.
These are new tests
packages/core/core-flows/src/auth/steps/validate-reset-password-token.ts
Outdated
Show resolved
Hide resolved
packages/medusa/src/api/auth/[actor_type]/[auth_provider]/reset-password/route.ts
Outdated
Show resolved
Hide resolved
packages/medusa/src/api/auth/[actor_type]/[auth_provider]/reset-password/route.ts
Outdated
Show resolved
Hide resolved
packages/modules/providers/auth-emailpass/src/services/emailpass.ts
Outdated
Show resolved
Hide resolved
packages/core/core-flows/src/auth/steps/validate-reset-password-token.ts
Outdated
Show resolved
Hide resolved
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.
looks good, added some questions/suggestions
packages/modules/providers/auth-emailpass/src/services/emailpass.ts
Outdated
Show resolved
Hide resolved
5977d22
to
153272f
Compare
a4876bb
to
9a3f0a6
Compare
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.
Very nice, just one security concern, otherwise LGTM
packages/core/core-flows/src/auth/workflows/generate-reset-password-token.ts
Outdated
Show resolved
Hide resolved
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.
Really nice one, I was someone asking if we'll support resets just today, so timely as well 😄
@olivermrbl I'll merge this one so I can do the rebase conflicts |
Generate reset password token:
POST /auth/user/emailpass/reset-password { identifier: "oli@oli.com" }
generateResetPasswordToken
workflowgenerateToken
Reset password:
POST /auth/user/emailpass/update?token="..." { email: "oli@oli.com", password: "***" }
authModule.updateProvider
authProvider.update