public Optional<User> login(String nameOrEmail, String password) {
		if (nameOrEmail == null || password == null) {
			return Optional.empty();
		}

		User user = userDAO.findByName(nameOrEmail);
		if (user == null) {
			user = userDAO.findByEmail(nameOrEmail);
		}
		if (user != null && !user.isDisabled()) {
			boolean authenticated = encryptionService.authenticate(password, user.getPassword(), user.getSalt());
			if (authenticated) {
				performPostLoginActivities(user);
				return Optional.of(user);
			}
		}
		return Optional.empty();
	}
@Test
	void apiLoginShouldNotReturnUserIfUserNotFoundFromLookupByApikey() {
		Mockito.when(userDAO.findByApiKey("apikey")).thenReturn(null);
		Optional<User> user = userService.login("apikey");
		Assertions.assertFalse(user.isPresent());
	}