| Line 149... |
Line 149... |
| 149 |
userService.resetPassword(emailOrMobile, password);
|
149 |
userService.resetPassword(emailOrMobile, password);
|
| 150 |
}
|
150 |
}
|
| 151 |
}
|
151 |
}
|
| 152 |
|
152 |
|
| 153 |
@Override
|
153 |
@Override
|
| - |
|
154 |
public AuthUser resetAuthUserPassword(String emailOrMobile, String password) throws ProfitMandiBusinessException {
|
| - |
|
155 |
// Reset ONLY the auth_user password (by email or mobile); no dtr.users cascade
|
| - |
|
156 |
// (most auth users / mobile identifiers have no dtr.users row -> would 400).
|
| - |
|
157 |
AuthUser authUser = authRepository.selectByEmailOrMobile(emailOrMobile);
|
| - |
|
158 |
authUser.setPassword(getHash256(password));
|
| - |
|
159 |
return authUser;
|
| - |
|
160 |
}
|
| - |
|
161 |
|
| - |
|
162 |
@Override
|
| 154 |
public void changePassword(String emailOrMobile, String oldPassword, String newPassword) throws ProfitMandiBusinessException {
|
163 |
public void changePassword(String emailOrMobile, String oldPassword, String newPassword) throws ProfitMandiBusinessException {
|
| 155 |
if (authRepository.authenticate(emailOrMobile, getHash256(oldPassword))) {
|
164 |
if (authRepository.authenticate(emailOrMobile, getHash256(oldPassword))) {
|
| 156 |
AuthUser authUser = authRepository.selectByEmailOrMobile(emailOrMobile);
|
165 |
AuthUser authUser = authRepository.selectByEmailOrMobile(emailOrMobile);
|
| 157 |
authUser.setPassword(getHash256(newPassword));
|
166 |
authUser.setPassword(getHash256(newPassword));
|
| 158 |
userService.resetPassword(authUser.getEmailId(), newPassword);
|
167 |
userService.resetPassword(authUser.getEmailId(), newPassword);
|