mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-12 04:15:25 +00:00
refac
This commit is contained in:
parent
2b2d123531
commit
6f6412dd16
4 changed files with 5 additions and 5 deletions
|
|
@ -166,7 +166,7 @@ def get_headers_and_cookies(
|
||||||
elif auth_type == "session":
|
elif auth_type == "session":
|
||||||
cookies = request.cookies
|
cookies = request.cookies
|
||||||
token = request.state.token.credentials
|
token = request.state.token.credentials
|
||||||
elif auth_type == "oauth":
|
elif auth_type == "system_oauth":
|
||||||
cookies = request.cookies
|
cookies = request.cookies
|
||||||
|
|
||||||
oauth_token = None
|
oauth_token = None
|
||||||
|
|
|
||||||
|
|
@ -135,7 +135,7 @@ async def get_tools(
|
||||||
headers["Authorization"] = (
|
headers["Authorization"] = (
|
||||||
f"Bearer {request.state.token.credentials}"
|
f"Bearer {request.state.token.credentials}"
|
||||||
)
|
)
|
||||||
elif auth_type == "oauth":
|
elif auth_type == "system_oauth":
|
||||||
cookies = request.cookies
|
cookies = request.cookies
|
||||||
oauth_token = extra_params.get("__oauth_token__", None)
|
oauth_token = extra_params.get("__oauth_token__", None)
|
||||||
if oauth_token:
|
if oauth_token:
|
||||||
|
|
|
||||||
|
|
@ -330,7 +330,7 @@
|
||||||
{#if !ollama}
|
{#if !ollama}
|
||||||
<option value="session">{$i18n.t('Session')}</option>
|
<option value="session">{$i18n.t('Session')}</option>
|
||||||
{#if !direct}
|
{#if !direct}
|
||||||
<option value="oauth">{$i18n.t('OAuth')}</option>
|
<option value="system_oauth">{$i18n.t('OAuth')}</option>
|
||||||
{/if}
|
{/if}
|
||||||
{/if}
|
{/if}
|
||||||
</select>
|
</select>
|
||||||
|
|
@ -355,7 +355,7 @@
|
||||||
>
|
>
|
||||||
{$i18n.t('Forwards system user session credentials to authenticate')}
|
{$i18n.t('Forwards system user session credentials to authenticate')}
|
||||||
</div>
|
</div>
|
||||||
{:else if auth_type === 'oauth'}
|
{:else if auth_type === 'system_oauth'}
|
||||||
<div
|
<div
|
||||||
class={`text-xs self-center translate-y-[1px] ${($settings?.highContrastMode ?? false) ? 'text-gray-800 dark:text-gray-100' : 'text-gray-500'}`}
|
class={`text-xs self-center translate-y-[1px] ${($settings?.highContrastMode ?? false) ? 'text-gray-800 dark:text-gray-100' : 'text-gray-500'}`}
|
||||||
>
|
>
|
||||||
|
|
|
||||||
|
|
@ -289,7 +289,7 @@
|
||||||
<option value="session">{$i18n.t('Session')}</option>
|
<option value="session">{$i18n.t('Session')}</option>
|
||||||
|
|
||||||
{#if !direct}
|
{#if !direct}
|
||||||
<option value="oauth">{$i18n.t('OAuth')}</option>
|
<option value="system_oauth">{$i18n.t('OAuth')}</option>
|
||||||
{/if}
|
{/if}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue