Skip to content

Commit

Permalink
Use SPACE_HOST instead of SPACE_SUBDOMAIN (#946)
Browse files Browse the repository at this point in the history
* Use SPACE_HOST instead of SPACE_SUBDOMAIN

* Update docs/hub/spaces-overview.md

Co-authored-by: Omar Sanseviero <[email protected]>
  • Loading branch information
XciD and osanseviero authored Sep 12, 2023
1 parent 1b3dea9 commit 4bb6073
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
6 changes: 3 additions & 3 deletions docs/hub/spaces-oauth.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ As for any other environment variable, you can use them in your code by using `o

The allowed redirect URIs for your OAuth app are:

- `https://{SPACE_SUBDOMAIN}.hf.space/auth/callback`
- `https://{SPACE_SUBDOMAIN}.hf.space/login/callback`
- `https://{SPACE_HOST}/auth/callback`
- `https://{SPACE_HOST}/login/callback`

Note that `SPACE_SUBDOMAIN` is also [available](https://huggingface.co/docs/hub/spaces-overview#helper-environment-variables) as an environment variable.
Note that `SPACE_HOST` is also [available](https://huggingface.co/docs/hub/spaces-overview#helper-environment-variables) as an environment variable.

You can add a custom relative redirect path by setting `hf_oauth_redirect_path` in your Space's metadata.

Expand Down
3 changes: 1 addition & 2 deletions docs/hub/spaces-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ In some cases, you might be interested in having programmatic access to the Spac
* `SPACE_REPO_NAME`: i-like-flan
* `SPACE_TITLE`: I Like Flan (specified in the README file)
* `SPACE_ID`: `osanseviero/i-like-flan`
* `SPACE_SUBDOMAIN`: `osanviero-i-like-flan` (the space's embed url is https://osanviero-i-like-flan.hf.space)
* `SPACE_HOST`: `osanseviero-i-like-flan.hf.space`

In case [OAuth](./spaces-oauth) is enabled for your Space, the following variables will also be available:

Expand Down Expand Up @@ -149,4 +149,3 @@ models:
- reach-vb/musicgen-large-fp16-endpoint
- reach-vb/wav2vec2-large-xls-r-1B-common_voice7-lt-ft
```

0 comments on commit 4bb6073

Please sign in to comment.