|
@@ -82,10 +82,10 @@ public class AuthController {
|
82
|
82
|
|
83
|
83
|
user.setPassword(passwordEncoder.encode(user.getPassword()));
|
84
|
84
|
|
85
|
|
-// Role userRole = roleRepository.findByName(RoleName.ROLE_USER)
|
86
|
|
-// .orElseThrow(() -> new AppException("User Role not set."));
|
87
|
|
-//
|
88
|
|
-// user.setRoles(Collections.singleton(userRole));
|
|
85
|
+ Role userRole = roleRepository.findByName(RoleName.ROLE_USER)
|
|
86
|
+ .orElseThrow(() -> new AppException("User Role not set."));
|
|
87
|
+
|
|
88
|
+ user.setRoles(Collections.singleton(userRole));
|
89
|
89
|
|
90
|
90
|
User result = userRepository.save(user);
|
91
|
91
|
|