working commit
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user