@Override public boolean isUserAuthenticated(User user, HttpSession session) { user = getUserDetail(user.getUsername(), user.getPassword()); if (user != null) { log.info(user.getEmailAddress()); if (session != null) { session.setAttribute("displayUser", user.getEmailAddress()); } return true; } return false; }
@Override public ResponseVO isUserAuthenticated(DoLoginVo doLoginVo, ResponseVO response) { User user = getUserDetail(doLoginVo.getAuthString()); List<AssignedTest> assignedTests = null; if (user != null) { UserProfile profile = getUserProfileByUUID(user.getUuid()); if (profile != null) { profile.setMobileNumber(user.getMobileNumber()); profile.setEmailAddress(user.getEmailAddress()); profile.setUsername(user.getUsername()); assignedTests = schoolAssesmentService.findAllAssignedTestByuser(user); } String accessToken = ApplicationUtilities.generateAccessToken(user); user.setAccessToken(accessToken); saveUser(user); response.setData(new LoggedInUserVO(accessToken, profile, assignedTests)); } else { response.setData("Invalid Student code!!"); } response.setSuccess(true); return response; }