Skip to content

feat(auth): password change #226

Open
Konzum59 wants to merge 5 commits into
mainfrom
feat/password-change-and-reset
Open

feat(auth): password change #226
Konzum59 wants to merge 5 commits into
mainfrom
feat/password-change-and-reset

Conversation

@Konzum59
Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings January 12, 2026 14:58
@Konzum59 Konzum59 requested a review from kguzek as a code owner January 12, 2026 14:58
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements a password change feature for authenticated users, adding a new password change form, API integration, validation schema, and UI navigation. While the title mentions "reset," only the password change functionality is implemented in this PR.

Changes:

  • Added password change feature with form validation (minimum 8 characters, passwords must match, new password must differ from old)
  • Integrated new API endpoint for password changes with error handling
  • Added navigation menu item and dedicated page for password changes
  • Modified backend logging to use warnings instead of errors for validation failures

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
src/features/password-change/schemas/change-password-schema.ts Defines validation schema with password matching and difference checks
src/features/password-change/index.ts Feature module exports for components, API, and schemas
src/features/password-change/components/change-password-form.tsx React form component with error handling and toast notifications
src/features/password-change/api/change-password.ts API integration function for password change endpoint
src/features/backend/utils/handle-response.ts Modified to log validation errors as warnings instead of errors
src/components/presentation/navbar.tsx Added "Change Password" menu item to user dropdown
src/app/(private)/change-password/page.tsx New page component for password change functionality

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/features/password-change/schemas/change-password-schema.ts Outdated
Comment thread src/features/password-change/components/change-password-form.tsx Outdated
Comment thread src/features/password-change/api/change-password.ts Outdated
Comment thread src/features/password-change/components/change-password-form.tsx
Comment thread src/features/password-change/components/change-password-form.tsx Outdated
Comment thread src/features/password-change/schemas/change-password-schema.ts Outdated
Comment thread src/features/password-change/components/change-password-form.tsx Outdated
@kguzek kguzek changed the title Feat/password change and reset feat(auth): password change and reset Feb 16, 2026
@kguzek kguzek linked an issue Feb 16, 2026 that may be closed by this pull request
Copy link
Copy Markdown
Member

@kguzek kguzek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

brakuje implementacji opcji 'zapomniałem hasła' w formularzu zalogowania

przeczytaj też komentarze od copilota, wiszą od dawna a niektóre uwagi dość trafne są

Comment thread src/features/backend/utils/handle-response.ts
Comment thread src/app/(private)/change-password/page.tsx Outdated
Comment thread src/features/password-change/components/change-password-form.tsx Outdated
Comment thread src/features/password-change/components/change-password-form.tsx Outdated
Comment thread src/features/password-change/api/change-password.ts Outdated
Comment thread src/features/password-change/index.ts Outdated
Comment thread src/features/password-change/api/change-password.ts Outdated
Comment thread src/features/password-change/api/change-password.ts Outdated
@kguzek kguzek force-pushed the feat/password-change-and-reset branch from 4d293c6 to 720a346 Compare February 22, 2026 20:02
Copilot AI review requested due to automatic review settings March 25, 2026 19:58
@kguzek kguzek force-pushed the feat/password-change-and-reset branch from 720a346 to e2e1cce Compare March 25, 2026 19:58
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/features/password-change/components/change-password-form.tsx
Comment thread src/features/password-change/index.ts Outdated
@Konzum59 Konzum59 requested a review from michalges April 23, 2026 17:27
@kguzek
Copy link
Copy Markdown
Member

kguzek commented Apr 24, 2026

@Konzum59 zrebasuj też brancha:)

Copy link
Copy Markdown
Member

@michalges michalges left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Jeśli będziesz robił "Zapomniałem hasła" w osobnej pr'ce to zrób issue od razu

if (fieldName === "oldPassword" && typeof message === "string") {
form.setError("oldPassword", {
type: "server",
message,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To wywali surowy error message po angielsku, zamist tego lepiej toast z predefiniowanym, polskim napisem. Raczej można założyć, że jak pojawia się błąd z oldPassword to użytkownik podał niepoprawne hałso.

control={form.control}
name="newPasswordConfirm"
render={({ field }) => (
<PasswordInput
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Może trochę czepliwie, ale imo tooltipy jak "Pokaż potwierdź nowe hasło" są trochę długie i niepotrzebne, wystarczyłoby "Pokaż hasło". Ale to bardziej jako propozycja

Comment thread src/app/(private)/change-password/page.tsx Outdated
Copilot AI review requested due to automatic review settings May 11, 2026 14:39
@Konzum59 Konzum59 changed the title feat(auth): password change and reset feat(auth): password change May 11, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Comment on lines +7 to +21
.object({
oldPassword: RequiredStringSchema,
newPassword: RequiredStringSchema.min(8, {
message: FORM_ERROR_MESSAGES.CHANGE_PASSWORD_MIN_LENGTH,
})
.regex(/[A-Z]/, {
message: FORM_ERROR_MESSAGES.CHANGE_PASSWORD_REQUIRE_UPPER,
})
.regex(/[a-z]/, {
message: FORM_ERROR_MESSAGES.CHANGE_PASSWORD_REQUIRE_LOWER,
})
.regex(/[0-9]/, {
message: FORM_ERROR_MESSAGES.CHANGE_PASSWORD_REQUIRE_NUMBER,
}),
newPasswordConfirm: RequiredStringSchema,
Comment on lines +48 to +58
let toastMessage: string | undefined;
try {
toastMessage = (
getToastMessages.changePassword as { invalidOldPassword?: string }
).invalidOldPassword;
} catch (error_) {
logger.error(
parseError(error_),
"ChangePasswordForm: failed to get invalidOldPassword message",
);
}
Comment on lines +1 to +8
import { ChangePasswordForm } from "@/features/password-change";

export default function ChangePasswordPage() {
return (
<div className="container mx-auto flex h-full flex-col items-center justify-center p-4 sm:p-8">
<h1 className="mb-4 text-2xl font-semibold">Zmiana hasła</h1>
<ChangePasswordForm />
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dodać możliwość resetowania hasła

4 participants