diff --git a/Makefile b/Makefile index caa845b..50ae327 100644 --- a/Makefile +++ b/Makefile @@ -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} diff --git a/internal/services/session.go b/internal/services/session.go index e6c2c8d..70e1127 100644 --- a/internal/services/session.go +++ b/internal/services/session.go @@ -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 { diff --git a/internal/transport/interceptors.go b/internal/transport/interceptors.go index 72ec4b2..24a623f 100644 --- a/internal/transport/interceptors.go +++ b/internal/transport/interceptors.go @@ -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()