mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
Cover SecurityCheckProvider.SecurityCheckInjectable.cookieLogin with tests
This commit is contained in:
@@ -54,7 +54,7 @@ public class UserService {
|
||||
boolean authenticated = encryptionService.authenticate(password, user.getPassword(), user.getSalt());
|
||||
if (authenticated) {
|
||||
afterLogin(user);
|
||||
return Optional.fromNullable(user);
|
||||
return Optional.of(user);
|
||||
}
|
||||
}
|
||||
return Optional.absent();
|
||||
|
||||
@@ -35,7 +35,7 @@ public class SecurityCheckProvider implements InjectableProvider<SecurityCheck,
|
||||
}
|
||||
|
||||
@RequiredArgsConstructor
|
||||
private static class SecurityCheckInjectable<T> extends AbstractHttpContextInjectable<User> {
|
||||
static class SecurityCheckInjectable<T> extends AbstractHttpContextInjectable<User> {
|
||||
private static final String PREFIX = "Basic";
|
||||
|
||||
private final HttpServletRequest request;
|
||||
@@ -66,7 +66,7 @@ public class SecurityCheckProvider implements InjectableProvider<SecurityCheck,
|
||||
}
|
||||
}
|
||||
|
||||
private Optional<User> cookieSessionLogin() {
|
||||
Optional<User> cookieSessionLogin() {
|
||||
return userService.login(request.getSession(false));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user