Add initial password setup functionality: implement email sending for new account password setup and update user interface to include password setup button

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
troogs
2026-04-26 11:00:43 +02:00
parent 870930914e
commit b0866754e0
3 changed files with 47 additions and 3 deletions

View File

@@ -22,6 +22,12 @@ namespace FoodsharingSiegen.Server.Pages
[Inject]
public UserService UserService { get; set; } = null!;
[Inject]
public new FoodsharingSiegen.Server.Auth.AuthService AuthService { get; set; } = null!;
[Inject]
public new NavigationManager NavigationManager { get; set; } = null!;
#endregion
#region Private Properties
@@ -115,6 +121,14 @@ namespace FoodsharingSiegen.Server.Pages
PasswordModal?.Show(user);
}
private async Task SendPasswordSetupMail(User user)
{
await ConfirmDialog.ShowAsync(ModalService, "Bestätigen", $"Soll eine E-Mail zum Festlegen des Passworts an {user.Mail} gesendet werden?", async () =>
{
await AuthService.InitiateInitialPasswordSetup(user.Mail, NavigationManager.BaseUri);
});
}
private async Task SaveUser()
{
if (EditModel == null) return;