working commit

This commit is contained in:
2026-06-08 09:42:32 +02:00
parent 0506b35cd1
commit 5f16f33a8b
21 changed files with 786 additions and 114 deletions
+2
View File
@@ -17,12 +17,14 @@ func (hand *Handler) Authentificate(ctx context.Context) (string, error) {
meta, _ := metadata.FromIncomingContext(ctx)
usernameArr := meta["username"]
passwordArr := meta["password"]
if len(usernameArr) == 0 || len(passwordArr) == 0 {
err := status.Errorf(codes.PermissionDenied, "Empty auth data")
return accountID, err
}
username := meta["username"][0]
password := meta["password"][0]
//hand.log.Debugf("Auth pair: [%s:%s]", username, password)
validated, accountID, err := hand.oper.ValidateAccount(ctx, username, password)
if !validated {
err := status.Errorf(codes.PermissionDenied, "Wrong auth data")