Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -12,7 +12,7 @@ HTML_ROOT = """
|
|
12 |
<head>
|
13 |
<meta charset="UTF-8">
|
14 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
15 |
-
<title>FastAPI
|
16 |
<style>
|
17 |
body {
|
18 |
margin: 0;
|
@@ -69,16 +69,13 @@ LOGIN_BUTTON = """
|
|
69 |
|
70 |
LOGOUT_BUTTON = """
|
71 |
<div id="container">
|
72 |
-
<!-- Sign-out button (hidden initially) -->
|
73 |
<button id="sign-out" style="display: none;">Sign Out</button>
|
74 |
-
|
75 |
-
<!-- JSON output container -->
|
76 |
<pre id="json-output" style="display: none;">{}</pre>
|
77 |
</div>
|
78 |
"""
|
79 |
|
80 |
@app.get("/", response_class=HTMLResponse)
|
81 |
-
def
|
82 |
oauth_info = parse_huggingface_oauth(request)
|
83 |
return HTML_ROOT.format(content=LOGOUT_BUTTON if oauth_info is not None else LOGIN_BUTTON)
|
84 |
|
|
|
12 |
<head>
|
13 |
<meta charset="UTF-8">
|
14 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
15 |
+
<title>FastAPI x OAuth</title>
|
16 |
<style>
|
17 |
body {
|
18 |
margin: 0;
|
|
|
69 |
|
70 |
LOGOUT_BUTTON = """
|
71 |
<div id="container">
|
|
|
72 |
<button id="sign-out" style="display: none;">Sign Out</button>
|
|
|
|
|
73 |
<pre id="json-output" style="display: none;">{}</pre>
|
74 |
</div>
|
75 |
"""
|
76 |
|
77 |
@app.get("/", response_class=HTMLResponse)
|
78 |
+
def page():
|
79 |
oauth_info = parse_huggingface_oauth(request)
|
80 |
return HTML_ROOT.format(content=LOGOUT_BUTTON if oauth_info is not None else LOGIN_BUTTON)
|
81 |
|