Download frontend/src/utils/generate-github-auth-url.ts from ar08/zzz: direct link, hf CLI and curl.
- Browser
- Download file 572 Bytes
-
https://huggingface.co/spaces/ar08/zzz/resolve/main/frontend/src/utils/generate-github-auth-url.ts
- Command line
-
hf download hf://spaces/ar08/zzz/frontend/src/utils/generate-github-auth-url.ts
-
curl -L -o generate-github-auth-url.ts https://huggingface.co/spaces/ar08/zzz/resolve/main/frontend/src/utils/generate-github-auth-url.ts
572 Bytes
| /** | |
| * Generates a URL to redirect to for GitHub OAuth | |
| * @param clientId The GitHub OAuth client ID | |
| * @param requestUrl The URL of the request | |
| * @returns The URL to redirect to for GitHub OAuth | |
| */ | |
| export const generateGitHubAuthUrl = (clientId: string, requestUrl: URL) => { | |
| const redirectUri = `${requestUrl.origin}/oauth/github/callback`; | |
| const scope = "repo,user,workflow,offline_access"; | |
| return `https://github.com/login/oauth/authorize?client_id=${clientId}&redirect_uri=${encodeURIComponent(redirectUri)}&scope=${encodeURIComponent(scope)}`; | |
| }; | |