mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-15 13:55:19 +00:00
Merge pull request #8608 from rragundez/hotfix-get-picture
Hotfix get picture
This commit is contained in:
commit
eb17cf6915
1 changed files with 7 additions and 1 deletions
|
|
@ -261,8 +261,14 @@ class OAuthManager:
|
||||||
if picture_url:
|
if picture_url:
|
||||||
# Download the profile image into a base64 string
|
# Download the profile image into a base64 string
|
||||||
try:
|
try:
|
||||||
|
access_token = token.get("access_token")
|
||||||
|
get_kwargs = {}
|
||||||
|
if access_token:
|
||||||
|
get_kwargs["headers"] = {
|
||||||
|
"Authorization": f"Bearer {access_token}",
|
||||||
|
}
|
||||||
async with aiohttp.ClientSession() as session:
|
async with aiohttp.ClientSession() as session:
|
||||||
async with session.get(picture_url) as resp:
|
async with session.get(picture_url, **get_kwargs) as resp:
|
||||||
picture = await resp.read()
|
picture = await resp.read()
|
||||||
base64_encoded_picture = base64.b64encode(
|
base64_encoded_picture = base64.b64encode(
|
||||||
picture
|
picture
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue