forked from lchapo/dash-google-auth
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path__init__.py
34 lines (27 loc) · 789 Bytes
/
__init__.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import os
from dash import Dash
from flask import Flask
from .google_oauth import GoogleOAuth
# configure app
server = Flask(__name__)
app = Dash(
__name__,
server=server,
url_base_pathname='/',
auth='auth',
)
# configure google oauth using environment variables
server.secret_key = os.environ.get("FLASK_SECRET_KEY", "supersekrit")
server.config["GOOGLE_OAUTH_CLIENT_ID"] = os.environ["GOOGLE_OAUTH_CLIENT_ID"]
server.config["GOOGLE_OAUTH_CLIENT_SECRET"] = os.environ["GOOGLE_OAUTH_CLIENT_SECRET"]
# allow for insecure transport for local testing (remove in prod)
os.environ['OAUTHLIB_INSECURE_TRANSPORT'] = '1'
# designate list of authorized emails
authorized_emails = [
]
auth = GoogleOAuth(
app,
authorized_emails,
)