Update app.py
Browse files
app.py
CHANGED
@@ -16,7 +16,7 @@ from modules.dataset import query_emotion
|
|
16 |
# https://huggingface.co/spaces/{username}/{space}/settings
|
17 |
API_TOKEN = os.getenv("BIG_GAN_TOKEN")
|
18 |
|
19 |
-
CLIENT_ID =
|
20 |
CLIENT_SECRET = os.environ.get("GOOGLE_CLIENT_SECRET")
|
21 |
|
22 |
app = Flask(__name__)
|
@@ -28,7 +28,7 @@ def index():
|
|
28 |
|
29 |
@app.route("/login")
|
30 |
def login():
|
31 |
-
return redirect("https://accounts.google.com/o/oauth2/auth?response_type=code&client_id={}&redirect_uri=http://localhost:
|
32 |
|
33 |
|
34 |
@app.route("/callback")
|
@@ -39,7 +39,7 @@ def callback():
|
|
39 |
"code": code,
|
40 |
"client_id": CLIENT_ID,
|
41 |
"client_secret": CLIENT_SECRET,
|
42 |
-
"redirect_uri": "http://localhost:
|
43 |
"grant_type": "authorization_code"
|
44 |
})
|
45 |
token_data = token_response.json()
|
|
|
16 |
# https://huggingface.co/spaces/{username}/{space}/settings
|
17 |
API_TOKEN = os.getenv("BIG_GAN_TOKEN")
|
18 |
|
19 |
+
CLIENT_ID = 730959404664-67d22lrege5tmtt64dv2pe2tsostvqil.apps.googleusercontent.com
|
20 |
CLIENT_SECRET = os.environ.get("GOOGLE_CLIENT_SECRET")
|
21 |
|
22 |
app = Flask(__name__)
|
|
|
28 |
|
29 |
@app.route("/login")
|
30 |
def login():
|
31 |
+
return redirect("https://accounts.google.com/o/oauth2/auth?response_type=code&client_id={}&redirect_uri=http://localhost:7860/callback&scope=email%20profile&access_type=offline".format(CLIENT_ID))
|
32 |
|
33 |
|
34 |
@app.route("/callback")
|
|
|
39 |
"code": code,
|
40 |
"client_id": CLIENT_ID,
|
41 |
"client_secret": CLIENT_SECRET,
|
42 |
+
"redirect_uri": "http://localhost:7860/callback",
|
43 |
"grant_type": "authorization_code"
|
44 |
})
|
45 |
token_data = token_response.json()
|