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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user