@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; }
@Override public void removeAccessToken(String accessToken) { User user = getUserByAccessToken(accessToken); user.setAccessToken(null); saveUser(user); }