use of org.craftercms.profile.exceptions.NoSuchPersistentLoginException in project profile by craftercms.
the class AuthenticationServiceImpl method refreshPersistentLoginToken.
@Override
public PersistentLogin refreshPersistentLoginToken(String loginId) throws ProfileException {
PersistentLogin login = getPersistentLogin(loginId);
if (login != null) {
try {
login.setToken(UUID.randomUUID().toString());
persistentLoginRepository.save(login);
logger.debug(LOG_KEY_PERSISTENT_LOGIN_TOKEN_REFRESHED, loginId, login.getToken());
return login;
} catch (MongoDataException e) {
throw new I10nProfileException(ERROR_KEY_UPDATE_PERSISTENT_LOGIN_ERROR, loginId);
}
} else {
throw new NoSuchPersistentLoginException(loginId);
}
}
Aggregations