|
@@ -56,14 +56,6 @@
|
|
|
}
|
|
|
};
|
|
|
|
|
|
- const ldapSignInHandler = async () => {
|
|
|
- const sessionUser = await ldapUserSignIn(ldapUsername, ldapPassword).catch((error) => {
|
|
|
- toast.error(error);
|
|
|
- return null;
|
|
|
- });
|
|
|
- await setSessionUser(sessionUser);
|
|
|
- };
|
|
|
-
|
|
|
const signInHandler = async () => {
|
|
|
const sessionUser = await userSignIn(email, password).catch((error) => {
|
|
|
toast.error(error);
|
|
@@ -94,6 +86,14 @@
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+ const ldapSignInHandler = async () => {
|
|
|
+ const sessionUser = await ldapUserSignIn(ldapUsername, ldapPassword).catch((error) => {
|
|
|
+ toast.error(error);
|
|
|
+ return null;
|
|
|
+ });
|
|
|
+ await setSessionUser(sessionUser);
|
|
|
+ };
|
|
|
+
|
|
|
const checkOauthCallback = async () => {
|
|
|
if (!$page.url.hash) {
|
|
|
return;
|
|
@@ -340,7 +340,7 @@
|
|
|
<div class="flex flex-col space-y-2">
|
|
|
{#if $config?.oauth?.providers?.google}
|
|
|
<button
|
|
|
- class="bg-gray-700/5 hover:bg-gray-700/10 dark:bg-gray-100/5 dark:hover:bg-gray-100/10 dark:text-gray-300 dark:hover:text-white transition w-full rounded-full font-medium text-sm py-2.5"
|
|
|
+ class="flex justify-center items-center bg-gray-700/5 hover:bg-gray-700/10 dark:bg-gray-100/5 dark:hover:bg-gray-100/10 dark:text-gray-300 dark:hover:text-white transition w-full rounded-full font-medium text-sm py-2.5"
|
|
|
on:click={() => {
|
|
|
window.location.href = `${WEBUI_BASE_URL}/oauth/google/login`;
|
|
|
}}
|
|
@@ -365,7 +365,7 @@
|
|
|
{/if}
|
|
|
{#if $config?.oauth?.providers?.microsoft}
|
|
|
<button
|
|
|
- class="bg-gray-700/5 hover:bg-gray-700/10 dark:bg-gray-100/5 dark:hover:bg-gray-100/10 dark:text-gray-300 dark:hover:text-white transition w-full rounded-full font-medium text-sm py-2.5"
|
|
|
+ class="flex justify-center items-center bg-gray-700/5 hover:bg-gray-700/10 dark:bg-gray-100/5 dark:hover:bg-gray-100/10 dark:text-gray-300 dark:hover:text-white transition w-full rounded-full font-medium text-sm py-2.5"
|
|
|
on:click={() => {
|
|
|
window.location.href = `${WEBUI_BASE_URL}/oauth/microsoft/login`;
|
|
|
}}
|
|
@@ -390,7 +390,7 @@
|
|
|
{/if}
|
|
|
{#if $config?.oauth?.providers?.oidc}
|
|
|
<button
|
|
|
- class="bg-gray-700/5 hover:bg-gray-700/10 dark:bg-gray-100/5 dark:hover:bg-gray-100/10 dark:text-gray-300 dark:hover:text-white transition w-full rounded-full font-medium text-sm py-2.5"
|
|
|
+ class="flex justify-center items-center bg-gray-700/5 hover:bg-gray-700/10 dark:bg-gray-100/5 dark:hover:bg-gray-100/10 dark:text-gray-300 dark:hover:text-white transition w-full rounded-full font-medium text-sm py-2.5"
|
|
|
on:click={() => {
|
|
|
window.location.href = `${WEBUI_BASE_URL}/oauth/oidc/login`;
|
|
|
}}
|
|
@@ -417,9 +417,10 @@
|
|
|
>
|
|
|
</button>
|
|
|
{/if}
|
|
|
+
|
|
|
{#if showSwitchButtonForSignInForm}
|
|
|
<button
|
|
|
- class="bg-gray-700/5 hover:bg-gray-700/10 dark:bg-gray-100/5 dark:hover:bg-gray-100/10 dark:text-gray-300 dark:hover:text-white transition w-full rounded-full font-medium text-sm py-2.5"
|
|
|
+ class="flex justify-center items-center bg-gray-700/5 hover:bg-gray-700/10 dark:bg-gray-100/5 dark:hover:bg-gray-100/10 dark:text-gray-300 dark:hover:text-white transition w-full rounded-full font-medium text-sm py-2.5"
|
|
|
on:click={() => {
|
|
|
if (mode === 'ldap')
|
|
|
mode = ($config?.onboarding ?? false) ? 'signup' : 'signin';
|
|
@@ -433,7 +434,7 @@
|
|
|
fill="none"
|
|
|
stroke-width="1.5"
|
|
|
stroke="currentColor"
|
|
|
- class="size-6 mr-3"
|
|
|
+ class="size-4 mr-3"
|
|
|
>
|
|
|
<path
|
|
|
stroke-linecap="round"
|
|
@@ -458,7 +459,7 @@
|
|
|
viewBox="0 0 24 24"
|
|
|
stroke-width="1.5"
|
|
|
stroke="currentColor"
|
|
|
- class="size-6 mr-3"
|
|
|
+ class="size-4 mr-3"
|
|
|
>
|
|
|
<path
|
|
|
stroke-linecap="round"
|