Skip to content

Commit 5f4d3a6

Browse files
committed
Fixed null error in auth database session handling
1 parent 37d1c85 commit 5f4d3a6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

backend/open_webui/models/oauth_sessions.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,11 @@ def create_session(
123123
"user_id": user_id,
124124
"provider": provider,
125125
"token": self._encrypt_token(token),
126-
"expires_at": token.get("expires_at"),
126+
"expires_at": token.get("expires_at") or (
127+
int(token.get("issued_at", current_time) + token.get("id_token_expires_in", 3600))
128+
if token.get("id_token_expires_in")
129+
else current_time + 3600
130+
),
127131
"created_at": current_time,
128132
"updated_at": current_time,
129133
}

0 commit comments

Comments
 (0)