diff --git a/webauthn-server-demo/src/main/java/demo/webauthn/InMemoryRegistrationStorage.java b/webauthn-server-demo/src/main/java/demo/webauthn/InMemoryRegistrationStorage.java index 4fefd3e31..72c99132f 100644 --- a/webauthn-server-demo/src/main/java/demo/webauthn/InMemoryRegistrationStorage.java +++ b/webauthn-server-demo/src/main/java/demo/webauthn/InMemoryRegistrationStorage.java @@ -94,15 +94,14 @@ public Optional lookup(ByteArray credentialId, ByteArray u credentialId, userHandle, registrationMaybe); - return registrationMaybe.flatMap( + return registrationMaybe.map( registration -> - Optional.of( - RegisteredCredential.builder() - .credentialId(registration.getCredential().getCredentialId()) - .userHandle(registration.getUserIdentity().getId()) - .publicKeyCose(registration.getCredential().getPublicKeyCose()) - .signatureCount(registration.getCredential().getSignatureCount()) - .build())); + RegisteredCredential.builder() + .credentialId(registration.getCredential().getCredentialId()) + .userHandle(registration.getUserIdentity().getId()) + .publicKeyCose(registration.getCredential().getPublicKeyCose()) + .signatureCount(registration.getCredential().getSignatureCount()) + .build()); } @Override