mirror of
https://github.com/teamhanko/hanko.git
synced 2025-11-01 22:28:27 +08:00
fix: merge conflicts. remove import in quickstart
This commit is contained in:
@ -7,7 +7,6 @@
|
||||
<meta name="theme-color" content="#042F4B">
|
||||
<title>Hanko Web Component Example</title>
|
||||
<link rel="stylesheet" href="static/css/index.css">
|
||||
<script type="module" src="{{.HankoElementUrl}}"></script>
|
||||
<link href="../static/img/Favicon_32x32.png" rel="shortcut icon" type="image/x-icon">
|
||||
<link href="../static/img/Favicon_256x256.png" rel="apple-touch-icon">
|
||||
</head>
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
<nav class="nav">
|
||||
<ul class="nav__itemList">
|
||||
<li class="nav__listItem">
|
||||
<a class="nav__link" href="/logout">Logout</a>
|
||||
<a href="#" class="nav__link" id="logout-link">Logout</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
@ -37,9 +37,22 @@
|
||||
<img alt="Powered by Hanko" src="static/img/poweredBy.svg"/>
|
||||
</footer>
|
||||
|
||||
|
||||
<script type="module">
|
||||
import {register} from "{{.HankoElementUrl}}";
|
||||
register({ shadow: false });
|
||||
|
||||
// TODO: Does this still work?
|
||||
const hanko = new hankoFrontendSdk.Hanko("{{.HankoUrl}}")
|
||||
|
||||
|
||||
document.getElementById("logout-link")
|
||||
.addEventListener("click", (event) => {
|
||||
event.preventDefault();
|
||||
hanko.user.logout()
|
||||
.then(() => { window.location.href = "/" })
|
||||
.catch(console.error);
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user