Spaces:
Running
Running
Download js/oauth-callback.js from ereniko/LocalWebAgent: direct link, hf CLI and curl.
- Browser
- Download file 595 Bytes
-
https://huggingface.co/spaces/ereniko/LocalWebAgent/resolve/main/js/oauth-callback.js
- Command line
-
hf download hf://spaces/ereniko/LocalWebAgent/js/oauth-callback.js
-
curl -L -o oauth-callback.js https://huggingface.co/spaces/ereniko/LocalWebAgent/resolve/main/js/oauth-callback.js
595 Bytes
| // Runs in oauth.html, the page Hugging Face redirects the sign-in popup to. | |
| import { completeSignIn } from "./hf-auth.js"; | |
| const title = document.getElementById("title"); | |
| const msg = document.getElementById("msg"); | |
| try { | |
| const r = await completeSignIn(); | |
| title.textContent = `Signed in${r.name ? ` as ${r.name}` : ""}`; | |
| title.className = "ok"; | |
| msg.textContent = "You can close this window and go back to LocalWebAgent."; | |
| setTimeout(() => window.close(), 700); | |
| } catch (err) { | |
| title.textContent = "Sign-in didn't work"; | |
| title.className = "bad"; | |
| msg.textContent = err.message; | |
| } | |