-
Notifications
You must be signed in to change notification settings - Fork 62
Issue 340 - Implement Forget password on Login page #353
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export { ForgotPasswordContainer as default } from '@containers'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export { ResetPasswordContainer as default } from '@containers'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -141,46 +141,78 @@ export const SIGNUP_FORM_SCHEMA = yup.object({ | |
| /[@$!%*?&#]/, | ||
| 'Password must contain at least one special character (@, $, !, %, *, ?, &, or #).', | ||
| ), | ||
| confirmPassword: yup | ||
| .string() | ||
| .when('newPassword', { | ||
| is: (newPassword: string) => newPassword && newPassword.length > 0, | ||
| then: (schema) => schema | ||
| confirmPassword: yup.string().when('newPassword', { | ||
| is: (newPassword: string) => newPassword && newPassword.length > 0, | ||
| then: (schema) => | ||
| schema | ||
| .required('Confirm Password is required') | ||
| .oneOf([yup.ref('newPassword')], 'Passwords must match'), | ||
| otherwise: (schema) => schema.optional().nullable() | ||
| }), | ||
| otherwise: (schema) => schema.optional().nullable(), | ||
| }), | ||
|
Comment on lines
+144
to
+151
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Resolve Biome Biome fails the build here because the object literal handed to - confirmPassword: yup.string().when('newPassword', {
- is: (newPassword: string) => newPassword && newPassword.length > 0,
- then: (schema) =>
- schema
- .required('Confirm Password is required')
- .oneOf([yup.ref('newPassword')], 'Passwords must match'),
- otherwise: (schema) => schema.optional().nullable(),
- }),
+ confirmPassword: yup
+ .string()
+ .when('newPassword', (newPassword, schema) =>
+ newPassword && newPassword.length > 0
+ ? schema
+ .required('Confirm Password is required')
+ .oneOf([yup.ref('newPassword')], 'Passwords must match')
+ : schema.optional().nullable(),
+ ),- confirmPassword: yup.string().when('newPassword', {
- is: (newPassword: string) => newPassword && newPassword.length > 0,
- then: (schema) =>
- schema
- .required('Confirm Password is required')
- .oneOf([yup.ref('newPassword')], 'Passwords must match'),
- otherwise: (schema) => schema.optional().nullable(),
- }),
+ confirmPassword: yup
+ .string()
+ .when('newPassword', (newPassword, schema) =>
+ newPassword && newPassword.length > 0
+ ? schema
+ .required('Confirm Password is required')
+ .oneOf([yup.ref('newPassword')], 'Passwords must match')
+ : schema.optional().nullable(),
+ ),As reported by Biome. Also applies to: 210-217 🧰 Tools🪛 Biome (2.1.2)[error] 146-146: Do not add then to an object. (lint/suspicious/noThenProperty) 🤖 Prompt for AI Agents |
||
| }); | ||
|
|
||
| export const FORGOT_PASSWORD_SCHEMA = yup.object({ | ||
| email: yup | ||
| .string() | ||
| .email('Please enter a valid email address') | ||
| .required('Email is required'), | ||
| }); | ||
|
|
||
| export const RESET_PASSWORD_SCHEMA = yup.object({ | ||
| new_password: yup | ||
| .string() | ||
| .required('Password is required.') | ||
| .min(8, 'Password must be at least 8 characters long.') | ||
| .max(20, 'Password cannot exceed 20 characters.') | ||
| .matches(/[A-Z]/, 'Password must contain at least one uppercase letter.') | ||
| .matches(/[a-z]/, 'Password must contain at least one lowercase letter.') | ||
| .matches(/[0-9]/, 'Password must contain at least one number.') | ||
| .matches( | ||
| /[@$!%*?&#]/, | ||
| 'Password must contain at least one special character (@, $, !, %, *, ?, &, or #).', | ||
| ), | ||
| confirm_password: yup | ||
| .string() | ||
| .required('Confirm password is required') // Ensure this is required | ||
| .oneOf([yup.ref('new_password')], 'Passwords must match'), | ||
| }); | ||
|
|
||
| export const EDIT_PROFILE_FORM_SCHEMA = yup.object({ | ||
| username: yup.string().required("Username is required"), | ||
| email: yup.string().email("Invalid email").required("Email is required").meta({ disabled: true }), | ||
| first_name: yup.string().required("First Name is required"), | ||
| last_name: yup.string().required("Last Name is required"), | ||
| username: yup.string().required('Username is required'), | ||
| email: yup | ||
| .string() | ||
| .email('Invalid email') | ||
| .required('Email is required') | ||
| .meta({ disabled: true }), | ||
| first_name: yup.string().required('First Name is required'), | ||
| last_name: yup.string().required('Last Name is required'), | ||
| gender: yup.string().optional().nullable(), | ||
| bio: yup.string().optional().nullable(), | ||
| about: yup.string().optional().nullable(), | ||
|
|
||
| website: yup.string().url("Invalid URL").optional().nullable(), | ||
| linkedin: yup.string().url("Invalid URL").optional().nullable(), | ||
| instagram: yup.string().url("Invalid URL").optional().nullable(), | ||
| github: yup.string().url("Invalid URL").optional().nullable(), | ||
| twitter: yup.string().url("Invalid URL").optional().nullable(), | ||
| mastodon: yup.string().url("Invalid URL").optional().nullable(), | ||
| website: yup.string().url('Invalid URL').optional().nullable(), | ||
| linkedin: yup.string().url('Invalid URL').optional().nullable(), | ||
| instagram: yup.string().url('Invalid URL').optional().nullable(), | ||
| github: yup.string().url('Invalid URL').optional().nullable(), | ||
| twitter: yup.string().url('Invalid URL').optional().nullable(), | ||
| mastodon: yup.string().url('Invalid URL').optional().nullable(), | ||
|
|
||
| country: yup.string().optional().nullable(), | ||
| organization: yup.string().optional().nullable(), | ||
| user_timezone: yup.string().optional().nullable(), | ||
| }); | ||
|
|
||
| export const CHANGE_PASSWORD_FORM_SCHEMA = yup.object({ | ||
| newPassword: yup.string().min(6, "Password must be at least 6 characters").required("Password is required"), | ||
| confirmPassword: yup.string() | ||
| .when('newPassword', { | ||
| is: (newPassword: string) => newPassword && newPassword.length > 0, | ||
| then: (schema) => schema | ||
| newPassword: yup | ||
| .string() | ||
| .min(6, 'Password must be at least 6 characters') | ||
| .required('Password is required'), | ||
| confirmPassword: yup.string().when('newPassword', { | ||
| is: (newPassword: string) => newPassword && newPassword.length > 0, | ||
| then: (schema) => | ||
| schema | ||
| .required('Confirm Password is required') | ||
| .oneOf([yup.ref('newPassword')], 'Passwords must match'), | ||
| otherwise: (schema) => schema.optional().nullable() | ||
| }), | ||
| }); | ||
| otherwise: (schema) => schema.optional().nullable(), | ||
| }), | ||
| }); | ||
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.
Fix contact email href mismatch.
The visible email shows
admin@djangoindia.org, but thehrefsends users tomailto:contact@djangoindia.org. That mismatch will route messages to the wrong inbox and confuse users who copy the address. Please align thehrefwith the displayed address (or update the display text) so clicks and copy-paste go to the same destination. (djangoindia.org)📝 Committable suggestion
🤖 Prompt for AI Agents