Skip to content

Commit 67549d9

Browse files
committed
Minor cleanup before upstream
1 parent f9fd4b2 commit 67549d9

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ ADMIN_API_SECRET=# secret to admin API calls, like computing usage stats or expo
180180
# These values cannot be updated at runtime
181181
# They need to be passed when building the docker image
182182
# See https://github.com/huggingface/chat-ui/main/.github/workflows/deploy-prod.yml#L44-L47
183-
APP_BASE="" # base path of the app, e.g. /chat, left blank as default
183+
APP_BASE="/" # base path of the app, e.g. /chat
184184
PUBLIC_APP_COLOR=blue # can be any of tailwind colors: https://tailwindcss.com/docs/customizing-colors#default-color-palette
185185
### Body size limit for SvelteKit https://svelte.dev/docs/kit/adapter-node#Environment-variables-BODY_SIZE_LIMIT
186186
BODY_SIZE_LIMIT=15728640

README.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ OPENID_CONFIG=`{
213213
SCOPES: "openid profile",
214214
TOLERANCE: // optional
215215
RESOURCE: // optional
216+
PROVIDER: // required only for group-based permissions
216217
}`
217218
```
218219

@@ -343,7 +344,8 @@ If [logging in with OpenID](#openid-connect) via a supported provider, then user
343344

344345
For all providers, see the following. Then, see additional instructions for your provider below.
345346

346-
1. Add `PROVIDER: "<provider-name-here>"` to your `.env.local` (you will enter the actual provider name later). Also, add `groups` to the `OPENID_CONFIG.SCOPES` field in your `.env.local` file:
347+
1. Add `PROVIDER: "<provider-name-here>"` to your `.env.local`. Also, add `groups` to the `OPENID_CONFIG.SCOPES` field in your `.env.local` file:
348+
347349
```env
348350
OPENID_CONFIG=`{
349351
// rest of OPENID_CONFIG here
@@ -358,8 +360,6 @@ OPENID_CONFIG=`{
358360
> [!WARNING]
359361
> The first model in your `.env.local` file is considered the "default" model and should be available to all users, so we strongly recommend against setting `allowed_groups` for this model.
360362
361-
> Note that during development, it is common to have `APP_BASE=""` in your `.env.local` - however, due to the cookies created by using a provider, this value should not be empty (e.g. setting `APP_BASE="/"` in `.env.local` would work).
362-
363363
#### Provider: Microsoft Entra
364364

365365
In order to enable use of [Microsoft Entra Security Groups](https://learn.microsoft.com/en-us/entra/fundamentals/concept-learn-about-groups) to show/hide models, do the following:
@@ -376,9 +376,8 @@ In order to enable use of [Microsoft Entra Security Groups](https://learn.micros
376376
```
377377

378378
3. Finally, configure your app in Microsoft Entra so that the app can access user groups via the MS Graph API:
379-
- [Add groups claim](https://learn.microsoft.com/en-gb/entra/identity-platform/optional-claims?tabs=appui#configure-groups-optional-claims) to your app
380-
- [Enable ID Tokens](https://learn.microsoft.com/en-us/entra/identity-platform/v2-protocols-oidc#enable-id-tokens) for your app
381-
379+
- [Add groups claim](https://learn.microsoft.com/en-gb/entra/identity-platform/optional-claims?tabs=appui#configure-groups-optional-claims) to your app
380+
- [Enable ID Tokens](https://learn.microsoft.com/en-us/entra/identity-platform/v2-protocols-oidc#enable-id-tokens) for your app
382381

383382
#### Running your own models using a custom endpoint
384383

src/hooks.server.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,8 @@ export const handle: Handle = async ({ event, resolve }) => {
231231
...(envPublic.PUBLIC_ORIGIN ? [new URL(envPublic.PUBLIC_ORIGIN).host] : []),
232232
];
233233

234-
// origin is null for some reason when the POST request callback comes from an auth provider like MS entra so we skip this check (CSRF token is still validated)
234+
// origin is null when the POST request callback comes from an auth provider like MS entra
235+
// so we skip this check (CSRF token is still validated)
235236
if (
236237
event.url.pathname !== `${base}/login/callback` &&
237238
!validOrigins.includes(new URL(origin).host)

0 commit comments

Comments
 (0)