From 70056bd0a97828472ec132fe1aa0dc0e4fd066d8 Mon Sep 17 00:00:00 2001 From: George Kalampokis Date: Wed, 4 Nov 2020 16:52:10 +0200 Subject: [PATCH] Fix issue with login for new users --- .../authentication/AbstractAuthenticationService.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/services/operations/authentication/AbstractAuthenticationService.java b/dmp-backend/web/src/main/java/eu/eudat/logic/services/operations/authentication/AbstractAuthenticationService.java index 8d38301b7..e9f347342 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/logic/services/operations/authentication/AbstractAuthenticationService.java +++ b/dmp-backend/web/src/main/java/eu/eudat/logic/services/operations/authentication/AbstractAuthenticationService.java @@ -119,8 +119,10 @@ public abstract class AbstractAuthenticationService implements AuthenticationSer .where((builder, root) -> builder.and(builder.equal(root.get("provider"), profile.getProvider().getValue()), builder.equal(root.get("externalId"), profile.getId()))) .getSingleOrDefault()); userInfo = optionalCredential.map(Credential::getUserInfo).orElse(null); - if (userInfo.getUserStatus() == 1) { - userInfo = null; + if (userInfo != null) { + if (userInfo.getUserStatus() == 1) { + userInfo = null; + } } //} if (userInfo == null) {