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
All checks were successful
Build And Push Dev Docker Image / docker (push) Successful in 1m52s
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user