209. Testing in Production (#32)
This commit is contained in:
10
README.md
10
README.md
@ -165,6 +165,12 @@ WantedBy=multi-user.target
|
||||
- `sudo systemctl status supportapi.service`
|
||||
- To enable your service on every reboot
|
||||
- `sudo systemctl enable supportapi.service`
|
||||
|
||||
|
||||
|
||||
#### 209. Testing in Production
|
||||
|
||||
- Test with:
|
||||
- Username: `art.shyshkin`
|
||||
- Password: `17aH!?o>CJ`
|
||||
- and another
|
||||
- Username: `shyshkin.art`
|
||||
- Password: `5C<"0dVx=>`
|
||||
|
||||
@ -153,6 +153,7 @@ public class UserServiceImpl implements UserService {
|
||||
validateNewUsernameAndEmail(username, email);
|
||||
|
||||
String rawPassword = generatePassword();
|
||||
log.debug("Added `{}` with Raw Password: {}", username, rawPassword);
|
||||
String encodedPassword = passwordEncoder.encode(rawPassword);
|
||||
|
||||
User newUser = userMapper.toEntity(userDto);
|
||||
@ -177,8 +178,8 @@ public class UserServiceImpl implements UserService {
|
||||
private void saveProfileImage(User user, MultipartFile profileImage) {
|
||||
if (profileImage == null) return;
|
||||
|
||||
if (!List.of(IMAGE_JPEG_VALUE, IMAGE_GIF_VALUE, IMAGE_PNG_VALUE).contains(profileImage.getContentType())){
|
||||
throw new NotAnImageFileException(profileImage.getOriginalFilename()+ " is not an image file. Please upload an image");
|
||||
if (!List.of(IMAGE_JPEG_VALUE, IMAGE_GIF_VALUE, IMAGE_PNG_VALUE).contains(profileImage.getContentType())) {
|
||||
throw new NotAnImageFileException(profileImage.getOriginalFilename() + " is not an image file. Please upload an image");
|
||||
}
|
||||
|
||||
Path userFolder = Paths.get(USER_FOLDER, user.getUserId());
|
||||
|
||||
Reference in New Issue
Block a user