Spaces:
Running
Running
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<meta name="viewport" content="width=device-width" /> | |
<title>My static Space</title> | |
<link rel="stylesheet" href="style.css" /> | |
<script src="https://unpkg.com/[email protected]/dist/es-module-shims.js"></script> | |
<script type="importmap"> | |
{ | |
"imports": { | |
"@huggingface/hub": "https://cdn.jsdelivr.net/npm/@huggingface/[email protected]/+esm" | |
} | |
} | |
</script> | |
</head> | |
<body> | |
<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" id="signin"> | |
<pre> | |
</pre> | |
<script type="module"> | |
import { oauthLoginUrl, oauthHandleRedirectIfPresent } from "@huggingface/hub"; | |
const oauthResult = await oauthHandleRedirectIfPresent(); | |
if (oauthResult) { | |
document.querySelector("pre").textContent = JSON.stringify(oauthResult, null, 2); | |
document.getElementById("signin").remove(); | |
} else { | |
document.getElementById("signin").onclick = async function() { | |
window.location.href = await oauthLoginUrl(); | |
} | |
} | |
</script> | |
</body> | |
</html> | |