Skip to content

Commit

Permalink
πŸ”€ Merge pull request #23 from FusionTech-2430/fix/user-claims
Browse files Browse the repository at this point in the history
πŸš‘ add custom claims when creating user
  • Loading branch information
Estebans441 authored Nov 5, 2024
2 parents 12509e2 + e5e3e1a commit a55190c
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ public UserDTO createUser(UserDTO userDto, MultipartFile photo) {
user.getRoles().add(rolEntity.get());
}

// Update claims
try{
firebaseService.updateCustomClaims(user.getIdUser(), userDto.getRoles());
} catch (FirebaseAuthException e) {
throw new OperationException(500, "Firebase authentication error: " + e.getMessage());
}

// Upload photo to firebase
if (photo != null) {
String photoName = user.getIdUser();
Expand Down

0 comments on commit a55190c

Please sign in to comment.