Fix running local app with fake OAuth (#8950)

* Fix running local app with fake OAuth

* add changeset

* lint

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
This commit is contained in:
Lucain 2024-07-31 22:02:21 +02:00 committed by GitHub
parent 1e16f67ba2
commit 7e997a85bb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 12 additions and 1 deletions

View File

@ -0,0 +1,5 @@
---
"gradio": minor
---
feat:Fix running local app with fake OAuth

View File

@ -2,6 +2,7 @@ from __future__ import annotations
import hashlib
import os
import time
import typing
import urllib.parse
import warnings
@ -296,7 +297,7 @@ def _get_mocked_oauth_info() -> typing.Dict:
"expires_in": 3600,
"id_token": "AAAAAAAAAAAAAAAAAAAAAAAAAA",
"scope": "openid profile",
"expires_at": 1691676444,
"expires_at": int(time.time()) + 8 * 60 * 60, # 8 hours
"userinfo": {
"sub": "11111111111111111111111",
"name": user["fullname"],

View File

@ -109,6 +109,11 @@ class Obj:
def __repr__(self) -> str:
return str(self.__dict__)
def pop(self, item, default=None):
if item in self:
return self.__dict__.pop(item)
return default
@document()
class Request: