Proba naprawienia

Signed-off-by: Marcin Woźniak <y0rune@aol.com>
This commit is contained in:
Marcin Woźniak 2021-01-08 15:19:45 +01:00
parent cfc1e3eba7
commit 1682448627
Signed by: y0rune
GPG Key ID: F204C385F57EB348

View File

@ -79,12 +79,18 @@ public class UserService {
*/
public User login(User authority) throws UserNotFoundException {
final String token = UUID.randomUUID().toString();
System.out.println(token);
if ((authority.getName() == null || authority.getSurname() == null) && authority.getUsosId() != null) {
final UserApiResponse resp = this.service.getUserData(authority.getUsosId());
authority.updateWithUsosData(resp);
System.out.println("PRAWIE WYCHODZE Z IFA");
}
try {
System.out.println("TRY!!!!");
authority.setToken(token);
System.out.println(authority.getToken());
System.out.println(authority.getName());
System.out.println(authority.getSurname());
this.repo.save(authority);
} catch (Exception e) {
throw new UserNotFoundException(e.getMessage());