Enhance user authentication and management: add unverified user check, update error messages, and improve user interface for better usability
All checks were successful
Build And Push Dev Docker Image / docker (push) Successful in 1m52s

This commit is contained in:
troogs
2026-04-26 10:28:31 +02:00
parent 54effa67ac
commit 870930914e
4 changed files with 195 additions and 145 deletions

View File

@@ -142,6 +142,12 @@ namespace FoodsharingSiegen.Server.Auth
if (_user != null)
{
if (_user.Type == UserType.Unverified)
{
_user = null;
return new OperationResult(new Exception("Anmeldung nicht möglich."));
}
var serializedToken = AuthHelper.CreateToken(_user);
await _localStorageService.SetItem(StorageKeys.TokenKey, serializedToken);
@@ -156,7 +162,7 @@ namespace FoodsharingSiegen.Server.Auth
return new OperationResult();
}
return new OperationResult(new Exception("Benutzername oder Passwort falsch"));
return new OperationResult(new Exception("E-Mail-Adresse oder Passwort ist ungültig."));
}
#endregion