Add personal team on registration
This commit is contained in:
1 parent
0010c92103
commit
50d1ba630e
2 files changed
+12
-1
No files matched your search
@@ -49,7 +49,18 @@ func (s *Service) Register(registration Registration) (*Session, error) {
|
||||
return nil, ErrRegistrationNotAllowed
|
||||
}
|
||||
if authenticator, ok := s.authenticators[registration.Method]; ok {
|
||||
return authenticator.Register(context.Background(), registration)
|
||||
session, err := authenticator.Register(context.Background(), registration)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
_, err = s.userRepository.CreateTeam(session.User.ID, &domain.Team{
|
||||
Label: "Espace personnel",
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return session, nil
|
||||
} else {
|
||||
return nil, ErrMethodUnknown
|
||||
}
|
||||
|
||||
Binary file not shown.
Reference in new issue
Block a user