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:
@buf generate
dev:
@ -6,4 +9,5 @@ dev:
build:
@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
}
err = s.sessionProvider.CreateSession(ctx, *user.Id)
if err != nil {
return nil, err
}
//err = s.sessionProvider.CreateSession(ctx, *user.Id)
//if err != nil {
// return nil, err
//}
s.sessionProvider.CreateSession(ctx, *user.Id) // FIXME
session, err := s.sessionProvider.ReadSessionByUserId(ctx, *user.Id)
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) {
reqWithToken, ok := req.(ReqWithToken)
if !ok {
return nil, status.Errorf(codes.Unauthenticated, "")
return handler(ctx, req)
}
token := reqWithToken.GetToken()