sanjeevbora commited on
Commit
1c7692e
·
verified ·
1 Parent(s): c2e8168

updated app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -4
app.py CHANGED
@@ -21,8 +21,7 @@ class RequestHandler(BaseHTTPRequestHandler):
21
  if self.path.startswith("/callback"):
22
  # Capture the authorization code
23
  code = self.path.split("code=")[1]
24
- token_url = f"{AUTH_URL}/token"
25
- response = requests.post(token_url, data={
26
  'client_id': CLIENT_ID,
27
  'client_secret': CLIENT_SECRET,
28
  'grant_type': 'authorization_code',
@@ -45,12 +44,11 @@ def start_http_server():
45
  httpd.serve_forever()
46
 
47
  def login():
48
- auth_url = f"{AUTHORITY_URL}/authorize?client_id={CLIENT_ID}&response_type=code&redirect_uri={REDIRECT_URI}&scope={SCOPE}"
49
  webbrowser.open(auth_url)
50
 
51
  def check_login():
52
  return "You are logged in!" if access_token else "You are not logged in."
53
-
54
  @spaces.GPU(duration=60)
55
  def gradio_interface():
56
  with gr.Blocks() as demo:
 
21
  if self.path.startswith("/callback"):
22
  # Capture the authorization code
23
  code = self.path.split("code=")[1]
24
+ response = requests.post(TOKEN_URL, data={
 
25
  'client_id': CLIENT_ID,
26
  'client_secret': CLIENT_SECRET,
27
  'grant_type': 'authorization_code',
 
44
  httpd.serve_forever()
45
 
46
  def login():
47
+ auth_url = f"{AUTH_URL}?client_id={CLIENT_ID}&response_type=code&redirect_uri={REDIRECT_URI}&scope={SCOPE}"
48
  webbrowser.open(auth_url)
49
 
50
  def check_login():
51
  return "You are logged in!" if access_token else "You are not logged in."
 
52
  @spaces.GPU(duration=60)
53
  def gradio_interface():
54
  with gr.Blocks() as demo: