Commit
•
5216363
1
Parent(s):
ac1a23b
Update index.html
Browse files- index.html +8 -2
index.html
CHANGED
@@ -15,7 +15,13 @@
|
|
15 |
</script>
|
16 |
</head>
|
17 |
<body>
|
18 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
<pre>
|
20 |
|
21 |
</pre>
|
@@ -26,8 +32,8 @@
|
|
26 |
|
27 |
if (oauthResult) {
|
28 |
document.querySelector("pre").textContent = JSON.stringify(oauthResult, null, 2);
|
29 |
-
document.getElementById("signin").remove();
|
30 |
} else {
|
|
|
31 |
document.getElementById("signin").onclick = async function() {
|
32 |
window.location.href = await oauthLoginUrl();
|
33 |
}
|
|
|
15 |
</script>
|
16 |
</head>
|
17 |
<body>
|
18 |
+
<div class="card">
|
19 |
+
<h1>OAuth in a static Space</h1>
|
20 |
+
<p>Checkout the <a href="https://huggingface.co/spaces/coyotte508/client-side-oauth/tree/main"><i>Files</i></a> tab to see the few lines of code
|
21 |
+
enabling this space</p>
|
22 |
+
<p>After clicking "Signin with HF", you will be redirected to this space and the access token + user info will be displayed.</p>
|
23 |
+
</div>
|
24 |
+
<img src="https://huggingface.co/datasets/huggingface/badges/resolve/main/sign-in-with-huggingface-xl-dark.svg" alt="Sign in with Hugging Face" style="cursor: pointer; display: none;" id="signin">
|
25 |
<pre>
|
26 |
|
27 |
</pre>
|
|
|
32 |
|
33 |
if (oauthResult) {
|
34 |
document.querySelector("pre").textContent = JSON.stringify(oauthResult, null, 2);
|
|
|
35 |
} else {
|
36 |
+
document.getElementById("signin").style.removeProperty("display");
|
37 |
document.getElementById("signin").onclick = async function() {
|
38 |
window.location.href = await oauthLoginUrl();
|
39 |
}
|