chore: fix auth status checks

This commit is contained in:
Steven
2023-12-06 23:03:24 +08:00
parent fa6693a7ae
commit 33dda9bf87
5 changed files with 65 additions and 10 deletions

View File

@ -14,6 +14,9 @@ func (s *APIV2Service) GetAuthStatus(ctx context.Context, _ *apiv2pb.GetAuthStat
if err != nil {
return nil, status.Errorf(codes.Unauthenticated, "failed to get current user: %v", err)
}
if user == nil {
return nil, status.Errorf(codes.Unauthenticated, "user not found")
}
return &apiv2pb.GetAuthStatusResponse{
User: convertUserFromStore(user),
}, nil