Skip to content

Commit ea6709c

Browse files
committed
Revert "Updated webauthn quickstarts"
This reverts commit 6934905.
1 parent e9f8580 commit ea6709c

File tree

6 files changed

+22
-23
lines changed

6 files changed

+22
-23
lines changed

security-webauthn-quickstart/src/main/resources/META-INF/resources/index.html

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
<li><a href="/api/users/me">User API</a></li>
4949
<li><a href="/api/admin">Admin API</a></li>
5050
<li><a href="/q/webauthn/logout">Logout</a></li>
51-
</ul>
5251
</nav>
5352
<div class="container">
5453
<div class="item">
@@ -87,7 +86,7 @@ <h1>Register</h1>
8786

8887
const loginButton = document.getElementById('login');
8988

90-
loginButton.addEventListener("click", (e) => {
89+
loginButton.onclick = () => {
9190
var userName = document.getElementById('userNameLogin').value;
9291
result.replaceChildren();
9392
webAuthn.login({ name: userName })
@@ -98,11 +97,11 @@ <h1>Register</h1>
9897
result.append("Login failed: "+err);
9998
});
10099
return false;
101-
});
100+
};
102101

103102
const registerButton = document.getElementById('register');
104103

105-
registerButton.addEventListener("click", (e) => {
104+
registerButton.onclick = () => {
106105
var userName = document.getElementById('userNameRegister').value;
107106
var firstName = document.getElementById('firstName').value;
108107
var lastName = document.getElementById('lastName').value;
@@ -115,7 +114,7 @@ <h1>Register</h1>
115114
result.append("Registration failed: "+err);
116115
});
117116
return false;
118-
});
117+
};
119118
</script>
120119
</body>
121120
</html>

security-webauthn-quickstart/src/test/java/org/acme/security/webauthn/test/WebAuthnResourceTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,9 @@ private void invokeCustomEndpoint(String uri, Filter cookieFilter, Consumer<Requ
9696
.then()
9797
.statusCode(200)
9898
.log().ifValidationFails()
99-
.cookie(WebAuthnEndpointHelper.getChallengeCookie(), Matchers.is(""))
100-
.cookie(WebAuthnEndpointHelper.getChallengeUsernameCookie(), Matchers.is(""))
101-
.cookie(WebAuthnEndpointHelper.getMainCookie(), Matchers.notNullValue());
99+
.cookie(WebAuthnController.CHALLENGE_COOKIE, Matchers.is(""))
100+
.cookie(WebAuthnController.USERNAME_COOKIE, Matchers.is(""))
101+
.cookie("quarkus-credential", Matchers.notNullValue());
102102
}
103103

104104
private void verifyLoggedIn(Filter cookieFilter, String userName, User user) {

security-webauthn-reactive-quickstart/src/main/java/org/acme/security/webauthn/LoginResource.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
import org.jboss.resteasy.reactive.RestForm;
1111

12-
import io.quarkus.hibernate.reactive.panache.common.WithTransaction;
12+
import io.quarkus.hibernate.reactive.panache.common.runtime.ReactiveTransactional;
1313
import io.quarkus.security.webauthn.WebAuthnLoginResponse;
1414
import io.quarkus.security.webauthn.WebAuthnRegisterResponse;
1515
import io.quarkus.security.webauthn.WebAuthnSecurity;
@@ -25,7 +25,7 @@ public class LoginResource {
2525

2626
@Path("/login")
2727
@POST
28-
@WithTransaction
28+
@ReactiveTransactional
2929
public Uni<Response> login(@RestForm String userName,
3030
@BeanParam WebAuthnLoginResponse webAuthnResponse,
3131
RoutingContext ctx) {
@@ -63,7 +63,7 @@ public Uni<Response> login(@RestForm String userName,
6363

6464
@Path("/register")
6565
@POST
66-
@WithTransaction
66+
@ReactiveTransactional
6767
public Uni<Response> register(@RestForm String userName,
6868
@BeanParam WebAuthnRegisterResponse webAuthnResponse,
6969
RoutingContext ctx) {

security-webauthn-reactive-quickstart/src/main/java/org/acme/security/webauthn/MyWebAuthnSetup.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
import java.util.Set;
88

99
import jakarta.enterprise.context.ApplicationScoped;
10-
import io.quarkus.hibernate.reactive.panache.common.WithTransaction;
10+
11+
import io.quarkus.hibernate.reactive.panache.common.runtime.ReactiveTransactional;
1112
import io.quarkus.security.webauthn.WebAuthnUserProvider;
1213
import io.smallrye.mutiny.Uni;
1314
import io.vertx.ext.auth.webauthn.AttestationCertificates;
@@ -16,21 +17,21 @@
1617
@ApplicationScoped
1718
public class MyWebAuthnSetup implements WebAuthnUserProvider {
1819

19-
@WithTransaction
20+
@ReactiveTransactional
2021
@Override
2122
public Uni<List<Authenticator>> findWebAuthnCredentialsByUserName(String userName) {
2223
return WebAuthnCredential.findByUserName(userName)
2324
.flatMap(MyWebAuthnSetup::toAuthenticators);
2425
}
2526

26-
@WithTransaction
27+
@ReactiveTransactional
2728
@Override
2829
public Uni<List<Authenticator>> findWebAuthnCredentialsByCredID(String credID) {
2930
return WebAuthnCredential.findByCredID(credID)
3031
.flatMap(MyWebAuthnSetup::toAuthenticators);
3132
}
3233

33-
@WithTransaction
34+
@ReactiveTransactional
3435
@Override
3536
public Uni<Void> updateOrStoreWebAuthnCredentials(Authenticator authenticator) {
3637
// leave the scooby user to the manual endpoint, because if we do it here it will be

security-webauthn-reactive-quickstart/src/main/resources/META-INF/resources/index.html

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
<li><a href="/api/users/me">User API</a></li>
4949
<li><a href="/api/admin">Admin API</a></li>
5050
<li><a href="/q/webauthn/logout">Logout</a></li>
51-
</ul>
5251
</nav>
5352
<div class="container">
5453
<div class="item">
@@ -87,7 +86,7 @@ <h1>Register</h1>
8786

8887
const loginButton = document.getElementById('login');
8988

90-
loginButton.addEventListener("click", (e) => {
89+
loginButton.onclick = () => {
9190
var userName = document.getElementById('userNameLogin').value;
9291
result.replaceChildren();
9392
webAuthn.login({ name: userName })
@@ -98,11 +97,11 @@ <h1>Register</h1>
9897
result.append("Login failed: "+err);
9998
});
10099
return false;
101-
});
100+
};
102101

103102
const registerButton = document.getElementById('register');
104103

105-
registerButton.addEventListener("click", (e) => {
104+
registerButton.onclick = () => {
106105
var userName = document.getElementById('userNameRegister').value;
107106
var firstName = document.getElementById('firstName').value;
108107
var lastName = document.getElementById('lastName').value;
@@ -115,7 +114,7 @@ <h1>Register</h1>
115114
result.append("Registration failed: "+err);
116115
});
117116
return false;
118-
});
117+
};
119118
</script>
120119
</body>
121120
</html>

security-webauthn-reactive-quickstart/src/test/java/org/acme/security/webauthn/test/WebAuthnResourceTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,9 @@ private void invokeCustomEndpoint(String uri, Filter cookieFilter, Consumer<Requ
9696
.then()
9797
.statusCode(200)
9898
.log().ifValidationFails()
99-
.cookie(WebAuthnEndpointHelper.getChallengeCookie(), Matchers.is(""))
100-
.cookie(WebAuthnEndpointHelper.getChallengeUsernameCookie(), Matchers.is(""))
101-
.cookie(WebAuthnEndpointHelper.getMainCookie(), Matchers.notNullValue());
99+
.cookie(WebAuthnController.CHALLENGE_COOKIE, Matchers.is(""))
100+
.cookie(WebAuthnController.USERNAME_COOKIE, Matchers.is(""))
101+
.cookie("quarkus-credential", Matchers.notNullValue());
102102
}
103103

104104
private void verifyLoggedIn(Filter cookieFilter, String userName, User user) {

0 commit comments

Comments
 (0)