Profil: Logout after password change
This commit is contained in:
@@ -48,6 +48,11 @@ namespace FoodsharingSiegen.Server.BaseClasses
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[Inject] protected IMessageService? Message { get; set; }
|
[Inject] protected IMessageService? Message { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the value of the navigation manager (ab)
|
||||||
|
/// </summary>
|
||||||
|
[Inject] protected NavigationManager? NavigationManager { get; set; }
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -33,9 +33,17 @@
|
|||||||
</Validations>
|
</Validations>
|
||||||
</Fields>
|
</Fields>
|
||||||
|
|
||||||
|
<hr />
|
||||||
|
|
||||||
<h3>Sicherheit</h3>
|
<h3>Sicherheit</h3>
|
||||||
<Button Color="Color.Primary" Class="mb-2" Clicked="() => PasswordModal?.Show(User)!">Passwort ändern</Button>
|
<p class="mt-4 mb-1">
|
||||||
<Button Color="Color.Danger" Class="mb-2" Clicked="RemoveAccount">Konto löschen</Button>
|
Die Änderung deines Passworts ist sofort aktiv. Im Anschluss wirst du ausgeloggt und kannst dich neu einloggen.
|
||||||
|
<Button Color="Color.Primary" Class="d-block" Clicked="() => PasswordModal?.Show(User)!"><i class="fa-solid fa-key"></i> Passwort ändern</Button>
|
||||||
|
</p>
|
||||||
|
<p class="mt-4 mb-1">
|
||||||
|
Dein Konto zu löschen ist endgültig und kann nicht rückgängig gemacht werden.
|
||||||
|
<Button Color="Color.Danger" Class="d-block" Clicked="RemoveAccount"><i class="fa-solid fa-trash"></i> Konto löschen</Button>
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<SetPasswordModal @ref="PasswordModal" OnPasswortSet="OnPasswordSet"></SetPasswordModal>
|
<SetPasswordModal @ref="PasswordModal" OnPasswortSet="OnPasswordSet"></SetPasswordModal>
|
||||||
@@ -92,8 +92,10 @@ namespace FoodsharingSiegen.Server.Pages
|
|||||||
private async Task OnPasswordSet(User arg)
|
private async Task OnPasswordSet(User arg)
|
||||||
{
|
{
|
||||||
var setPasswordR = await UserService?.SetPassword(arg)!;
|
var setPasswordR = await UserService?.SetPassword(arg)!;
|
||||||
if(setPasswordR.Success)
|
if (setPasswordR.Success)
|
||||||
await Notification?.Success("Dein neues Passwort wurde gespeichert")!;
|
NavigationManager?.NavigateTo("/logout");
|
||||||
|
else
|
||||||
|
await Notification?.Success(setPasswordR.ErrorMessage)!;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|||||||
Reference in New Issue
Block a user