fix login

This commit is contained in:
2025-05-20 02:04:13 +07:00
parent e0d39bbd72
commit 7de3a6324f
6 changed files with 60 additions and 30 deletions
+9 -2
View File
@@ -2,6 +2,7 @@ package services
import (
"context"
"encoding/base64"
"encoding/json"
"evening_detective/internal/models"
"evening_detective/internal/modules/password"
@@ -96,7 +97,10 @@ func (s *Services) GetTeam(ctx context.Context, req *proto.GetTeamReq) (*proto.G
}
res = append(res, newAction)
}
return &proto.GetTeamRsp{Actions: res}, err
return &proto.GetTeamRsp{
Name: team.Name,
Actions: res,
}, err
}
func (s *Services) GetTeamsCSV(ctx context.Context, req *proto.GetTeamsCSVReq) (*proto.GetTeamsCSVRsp, error) {
@@ -154,7 +158,10 @@ func (s *Services) getTeam(ctx context.Context) (*models.Team, error) {
if !ok {
return nil, status.Errorf(codes.Unauthenticated, "error creds")
}
teamId := teamIdArr[0]
teamId, err := base64.StdEncoding.DecodeString(teamIdArr[0])
if err != nil {
return nil, status.Errorf(codes.Unauthenticated, "error creds")
}
passwordArr, ok := md["password"]
if !ok {