Update index.html
Browse files- index.html +11 -2
index.html
CHANGED
@@ -23,10 +23,19 @@
|
|
23 |
<a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
|
24 |
</p>
|
25 |
</div>
|
|
|
|
|
|
|
26 |
<script type="module">
|
27 |
-
import { oauthLoginUrl } from "@huggingface/hub";
|
28 |
|
29 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
</script>
|
31 |
</body>
|
32 |
</html>
|
|
|
23 |
<a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
|
24 |
</p>
|
25 |
</div>
|
26 |
+
<pre>
|
27 |
+
|
28 |
+
</pre>
|
29 |
<script type="module">
|
30 |
+
import { oauthLoginUrl, oauthHandleRedirectIfPresent } from "@huggingface/hub";
|
31 |
|
32 |
+
const oauthResult = await oauthHandleRedirectIfPresent();
|
33 |
+
|
34 |
+
if (oauthResult) {
|
35 |
+
document.querySelector("pre").textContent = JSON.stringify(oauthResult, null, 2);
|
36 |
+
} else {
|
37 |
+
window.location.href = await oauthLoginUrl();
|
38 |
+
}
|
39 |
</script>
|
40 |
</body>
|
41 |
</html>
|