Пример #1
0
 @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;
 }
Пример #2
0
 @Override
 public void removeAccessToken(String accessToken) {
   User user = getUserByAccessToken(accessToken);
   user.setAccessToken(null);
   saveUser(user);
 }