diff --git a/.vscode/settings.json b/.vscode/settings.json index c32c1bbc3ef..0d24922796c 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -2,7 +2,7 @@ "editor.formatOnSave": true, "editor.defaultFormatter": "esbenp.prettier-vscode", "editor.codeActionsOnSave": { - "source.fixAll": true + "source.fixAll": "explicit" }, "eslint.validate": ["javascript", "svelte"] } diff --git a/src/lib/components/DisclaimerModal.svelte b/src/lib/components/DisclaimerModal.svelte index 7837869d6f2..290f558e173 100644 --- a/src/lib/components/DisclaimerModal.svelte +++ b/src/lib/components/DisclaimerModal.svelte @@ -2,17 +2,23 @@ import { base } from "$app/paths"; import { page } from "$app/stores"; import { PUBLIC_APP_DESCRIPTION, PUBLIC_APP_NAME } from "$env/static/public"; - import LogoHuggingFaceBorderless from "$lib/components/icons/LogoHuggingFaceBorderless.svelte"; import Modal from "$lib/components/Modal.svelte"; import { useSettingsStore } from "$lib/stores/settings"; import { cookiesAreEnabled } from "$lib/utils/cookiesAreEnabled"; + import { onMount } from "svelte"; import Logo from "./icons/Logo.svelte"; const settings = useSettingsStore(); + + let form: HTMLFormElement; + onMount(() => { + form.submit(); + }); -
+ diff --git a/src/lib/components/LoginModal.svelte b/src/lib/components/LoginModal.svelte index 1f239644ddd..e239490f374 100644 --- a/src/lib/components/LoginModal.svelte +++ b/src/lib/components/LoginModal.svelte @@ -2,13 +2,14 @@ import { base } from "$app/paths"; import { page } from "$app/stores"; import { PUBLIC_APP_DESCRIPTION, PUBLIC_APP_NAME } from "$env/static/public"; - import LogoHuggingFaceBorderless from "$lib/components/icons/LogoHuggingFaceBorderless.svelte"; import Modal from "$lib/components/Modal.svelte"; - import { useSettingsStore } from "$lib/stores/settings"; - import { cookiesAreEnabled } from "$lib/utils/cookiesAreEnabled"; + import { onMount } from "svelte"; import Logo from "./icons/Logo.svelte"; - const settings = useSettingsStore(); + let form: HTMLFormElement; + onMount(() => { + form.submit(); + }); @@ -22,42 +23,12 @@

{PUBLIC_APP_DESCRIPTION}

-

- You have reached the guest message limit, please Sign In with your Hugging Face account to - continue. -

-
- {#if $page.data.loginRequired} - - {:else} - - {/if} -
+ bind:this={form} + />
diff --git a/src/lib/server/auth.ts b/src/lib/server/auth.ts index 51583293524..f7810bd93c4 100644 --- a/src/lib/server/auth.ts +++ b/src/lib/server/auth.ts @@ -119,6 +119,7 @@ export async function getOIDCUserData(settings: OIDCSettings, code: string): Pro const userData: UserinfoResponse = await client.userinfo(token); const claims = token.claims(); + console.log(claims); userData["name"] = claims.name || (claims.unique_name as string); userData["email"] = claims.email || (claims.upn as string); userData["preferred_username"] = claims.name || (claims.unique_name as string);