Spaces:
Running
Running
Download test-oauth.html from dylanebert/VibeGame: direct link, hf CLI and curl.
- Browser
- Download file 1.03 kB
-
https://huggingface.co/spaces/dylanebert/VibeGame/resolve/main/test-oauth.html
- Command line
-
hf download hf://spaces/dylanebert/VibeGame/test-oauth.html
-
curl -L -o test-oauth.html https://huggingface.co/spaces/dylanebert/VibeGame/resolve/main/test-oauth.html
1.03 kB
| <html> | |
| <head> | |
| <title>OAuth Test</title> | |
| </head> | |
| <body> | |
| <h1>OAuth Test</h1> | |
| <button id="test-btn">Test OAuth URL Generation</button> | |
| <div id="result"></div> | |
| <script type="module"> | |
| import { oauthLoginUrl } from "@huggingface/hub"; | |
| document | |
| .getElementById("test-btn") | |
| .addEventListener("click", async () => { | |
| try { | |
| const url = await oauthLoginUrl({ | |
| clientId: "87f5f1d1-6e9e-4962-98f0-e5f3831ec988", | |
| redirectUrl: "http://localhost:7860/auth/callback", | |
| scopes: "openid profile inference-api", | |
| }); | |
| document.getElementById("result").innerHTML = ` | |
| <p>OAuth URL generated successfully:</p> | |
| <a href="${url}" target="_blank">${url}</a> | |
| `; | |
| } catch (error) { | |
| document.getElementById("result").innerHTML = ` | |
| <p style="color: red;">Error: ${error.message}</p> | |
| `; | |
| } | |
| }); | |
| </script> | |
| </body> | |
| </html> | |