[PR #212] feat: notify user when default admin password is still in use #203

Closed
opened 2026-02-26 17:37:44 +03:00 by kerem · 0 comments
Owner

Original Pull Request: https://github.com/Corsinvest/cv4pve-admin/pull/212

State: closed
Merged: Yes


Summary

  • Show a permanent top-center danger notification at login if the admin is still using the default password (Password123!)
  • Notification includes a direct link to the change password page that also dismisses the toast on click
  • Expose ApplicationHelper.UrlChangePassword (static, set by Profile module constructor, same pattern as UrlNewPveConfig)

Changes

  • MainLayout.razor.cs: add UserManager<ApplicationUser> and NotificationService to constructor; check default password in OnAfterRenderAsync
  • MainLayout.razor: add NotifyDefaultPassword() method with RenderFragment content (required in .razor for @<...> syntax)
  • ApplicationHelper.cs: add UrlChangePassword static property
  • Profile/Module.cs: extract passwordLink variable, set ApplicationHelper.UrlChangePassword, reuse in NavBar

Test plan

  • Login with default password (Password123!) → danger notification appears top-center
  • Click "Change password now" link → navigates to change password page and notification is dismissed
  • Login after changing password → no notification shown
**Original Pull Request:** https://github.com/Corsinvest/cv4pve-admin/pull/212 **State:** closed **Merged:** Yes --- ## Summary - Show a permanent top-center danger notification at login if the admin is still using the default password (`Password123!`) - Notification includes a direct link to the change password page that also dismisses the toast on click - Expose `ApplicationHelper.UrlChangePassword` (static, set by Profile module constructor, same pattern as `UrlNewPveConfig`) ## Changes - `MainLayout.razor.cs`: add `UserManager<ApplicationUser>` and `NotificationService` to constructor; check default password in `OnAfterRenderAsync` - `MainLayout.razor`: add `NotifyDefaultPassword()` method with `RenderFragment` content (required in `.razor` for `@<...>` syntax) - `ApplicationHelper.cs`: add `UrlChangePassword` static property - `Profile/Module.cs`: extract `passwordLink` variable, set `ApplicationHelper.UrlChangePassword`, reuse in NavBar ## Test plan - [ ] Login with default password (`Password123!`) → danger notification appears top-center - [ ] Click "Change password now" link → navigates to change password page and notification is dismissed - [ ] Login after changing password → no notification shown
kerem 2026-02-26 17:37:44 +03:00
kerem changed title from [PR #212] [MERGED] feat: notify user when default admin password is still in use to [PR #212] feat: notify user when default admin password is still in use 2026-03-07 19:57:28 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/cv4pve-admin#203
No description provided.