Spaces:
Paused
Paused
ypdated app.py
Browse files
app.py
CHANGED
|
@@ -44,8 +44,16 @@ def start_http_server():
|
|
| 44 |
httpd.serve_forever()
|
| 45 |
|
| 46 |
def login():
|
| 47 |
-
|
| 48 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
|
| 50 |
def check_login():
|
| 51 |
return "You are logged in!" if access_token else "You are not logged in."
|
|
|
|
| 44 |
httpd.serve_forever()
|
| 45 |
|
| 46 |
def login():
|
| 47 |
+
params = {
|
| 48 |
+
'client_id': CLIENT_ID,
|
| 49 |
+
'response_type': 'code',
|
| 50 |
+
'redirect_uri': REDIRECT_URI,
|
| 51 |
+
'response_mode': 'query',
|
| 52 |
+
'scope': SCOPE,
|
| 53 |
+
'state': 'random_state_string' # Optional: Use for security
|
| 54 |
+
}
|
| 55 |
+
login_url = f"{AUTH_URL}?{urlencode(params)}"
|
| 56 |
+
return login_url
|
| 57 |
|
| 58 |
def check_login():
|
| 59 |
return "You are logged in!" if access_token else "You are not logged in."
|