Package main.controller.account.password
Class PasswordManager
java.lang.Object
main.controller.account.password.PasswordManager
A class manages the password of a user
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
changePassword
(User user, String oldPassword, String newPassword) Changes the password of the userstatic boolean
checkPassword
(User user, String password) Checks if the password is correct
-
Constructor Details
-
PasswordManager
public PasswordManager()
-
-
Method Details
-
checkPassword
Checks if the password is correct- Parameters:
user
- the user whose password is to be checkedpassword
- the password to be checked- Returns:
- true if the password is correct, false otherwise
-
changePassword
public static void changePassword(User user, String oldPassword, String newPassword) throws PasswordIncorrectException Changes the password of the user- Parameters:
user
- the user whose password is to be changedoldPassword
- the old passwordnewPassword
- the new password- Throws:
PasswordIncorrectException
- if the old password is incorrect
-