Class UserSettingsService

java.lang.Object
io.github.navjotsrakhra.eventmanager.service.UserSettingsService

@Service public class UserSettingsService extends Object
The UserSettingsService class provides methods for managing user settings, including password changes.
  • Constructor Details

    • UserSettingsService

      public UserSettingsService(UserRepository repository, org.springframework.security.crypto.password.PasswordEncoder encoder)
      Constructor for the UserSettingsService class.
      Parameters:
      repository - The UserRepository used for managing user data.
      encoder - The PasswordEncoder used for encoding user passwords.
  • Method Details

    • changePassword

      public org.springframework.http.ResponseEntity<?> changePassword(Principal principal, String newPassword)
      Change the password for the currently logged-in user.
      Parameters:
      principal - The Principal object representing the currently logged-in user.
      newPassword - The new password to be set for the user.
      Returns:
      ResponseEntity indicating the result of the password change operation.