navigation

This commit is contained in:
2026-08-07 19:20:16 +02:00
parent 5810c4c94f
commit ff6ef46cd4
78 changed files with 681 additions and 282 deletions
+13 -2
View File
@@ -1,6 +1,10 @@
package user
import "trankilou.fr/lassistanoque/backend/internal/domain"
import (
"fmt"
"trankilou.fr/lassistanoque/backend/internal/domain"
)
type Service struct {
repo domain.UserRepository
@@ -13,5 +17,12 @@ func NewService(repo domain.UserRepository) *Service {
}
func (s *Service) GetUser(id string) (*domain.User, error) {
return s.repo.FindUser(id)
user, err := s.repo.FindUser(id)
if err != nil {
return nil, err
}
if !user.Enabled {
return nil, fmt.Errorf("unauthorized")
}
return user, nil
}