Download client/src/const.ts from Soha85/RAI: direct link, hf CLI and curl.
- Browser
- Download file 643 Bytes
-
https://huggingface.co/spaces/Soha85/RAI/resolve/main/client/src/const.ts
- Command line
-
hf download hf://spaces/Soha85/RAI/client/src/const.ts
-
curl -L -o const.ts https://huggingface.co/spaces/Soha85/RAI/resolve/main/client/src/const.ts
643 Bytes
| export { COOKIE_NAME, ONE_YEAR_MS } from "@shared/const"; | |
| // Generate login URL at runtime so redirect URI reflects the current origin. | |
| export const getLoginUrl = () => { | |
| const oauthPortalUrl = import.meta.env.VITE_OAUTH_PORTAL_URL; | |
| const appId = import.meta.env.VITE_APP_ID; | |
| const redirectUri = `${window.location.origin}/api/oauth/callback`; | |
| const state = btoa(redirectUri); | |
| const url = new URL(`${oauthPortalUrl}/app-auth`); | |
| url.searchParams.set("appId", appId); | |
| url.searchParams.set("redirectUri", redirectUri); | |
| url.searchParams.set("state", state); | |
| url.searchParams.set("type", "signIn"); | |
| return url.toString(); | |
| }; | |