mirror of
https://github.com/gradio-app/gradio.git
synced 2024-11-21 01:01:05 +08:00
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:
parent
1e16f67ba2
commit
7e997a85bb
5
.changeset/small-coins-rescue.md
Normal file
5
.changeset/small-coins-rescue.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
"gradio": minor
|
||||
---
|
||||
|
||||
feat:Fix running local app with fake OAuth
|
@ -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"],
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user