Skip to content

Commit

Permalink
Merge pull request #1953 from objectcomputing/hotfix-1923/inform-user…
Browse files Browse the repository at this point in the history
…-of-session-expiration

Hotfix 1923/inform user of session expiration
  • Loading branch information
mkimberlin authored Aug 30, 2022
2 parents 4287f65 + f304c73 commit c7c7db0
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
import com.objectcomputing.checkins.services.memberprofile.MemberProfile;
import com.objectcomputing.checkins.services.memberprofile.MemberProfileUtils;
import com.objectcomputing.checkins.services.permissions.Permission;
import com.objectcomputing.checkins.services.permissions.PermissionRepository;
import com.objectcomputing.checkins.services.permissions.PermissionServices;
import com.objectcomputing.checkins.services.role.Role;
import com.objectcomputing.checkins.services.role.RoleRepository;
import com.objectcomputing.checkins.services.role.RoleServices;
import io.micronaut.http.HttpResponse;
import io.micronaut.http.annotation.Controller;
Expand Down Expand Up @@ -55,9 +53,9 @@ public HttpResponse<CurrentUserDTO> currentUser(@Nullable Authentication authent

String workEmail = authentication.getAttributes().get("email").toString();
String imageUrl = authentication.getAttributes().get("picture") != null ? authentication.getAttributes().get("picture").toString() : "";
String name = authentication.getAttributes().get("name").toString().trim();
String firstName = name.substring(0, name.indexOf(' '));
String lastName = name.substring(name.indexOf(' ') + 1).trim();
String name = authentication.getAttributes().get("name") != null ? authentication.getAttributes().get("name").toString().trim() : null;
String firstName = name != null ? name.substring(0, name.indexOf(' ')) : "";
String lastName = name != null ? name.substring(name.indexOf(' ') + 1).trim() : "";

MemberProfile user = currentUserServices.findOrSaveUser(firstName, lastName, workEmail);
List<Permission> permissions = permissionServices.findUserPermissions(user.getId());
Expand Down

0 comments on commit c7c7db0

Please sign in to comment.