We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 685e30d commit 669f364Copy full SHA for 669f364
ch2/frontend/index.html
@@ -50,8 +50,17 @@
50
<body>
51
52
<div id="anonymous" style="display: none">
53
- <!-- TODO login should be async, see https://www.keycloak.org/docs/latest/upgrading/index.html#methods-for-login-are-now-async -->
54
- <button onclick="window.kc.login()">Login</button>
+ <button id="loginButton">Login</button>
+
55
+ <script>
56
+ document.getElementById('loginButton').addEventListener('click', async function() {
57
+ try {
58
+ await window.kc.login();
59
+ } catch (error) {
60
+ console.error("Login failed:", error);
61
+ }
62
+ });
63
+ </script>
64
</div>
65
66
<div id="user" style="display: none">
0 commit comments