This commit is contained in:
Vyacheslav1557 2024-10-05 19:30:54 +05:00
parent 331e413afa
commit ba26d05516
3 changed files with 11 additions and 6 deletions

View file

@ -1,3 +1,6 @@
tag = latest
gen: gen:
@buf generate @buf generate
dev: dev:
@ -6,4 +9,5 @@ dev:
build: build:
@make gen @make gen
# TODO: build dockerfile @docker build . -t ms-auth:${tag}
@#docker push ms-auth:${tag}

View file

@ -51,10 +51,11 @@ func (s *SessionService) Create(ctx context.Context, handle, password string) (*
return nil, err return nil, err
} }
err = s.sessionProvider.CreateSession(ctx, *user.Id) //err = s.sessionProvider.CreateSession(ctx, *user.Id)
if err != nil { //if err != nil {
return nil, err // return nil, err
} //}
s.sessionProvider.CreateSession(ctx, *user.Id) // FIXME
session, err := s.sessionProvider.ReadSessionByUserId(ctx, *user.Id) session, err := s.sessionProvider.ReadSessionByUserId(ctx, *user.Id)
if err != nil { if err != nil {

View file

@ -15,7 +15,7 @@ func (s *AuthServer) AuthInterceptor() grpc.UnaryServerInterceptor {
return func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) { return func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) {
reqWithToken, ok := req.(ReqWithToken) reqWithToken, ok := req.(ReqWithToken)
if !ok { if !ok {
return nil, status.Errorf(codes.Unauthenticated, "") return handler(ctx, req)
} }
token := reqWithToken.GetToken() token := reqWithToken.GetToken()