Skip to content

Commit 46b19b1

Browse files
committed
Specified domain/userinfo as audience
Default callback to localhost:3000/callback
1 parent 398329c commit 46b19b1

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

01-Login/server.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def handle_auth_error(ex):
5656
consumer_secret=AUTH0_CLIENT_SECRET,
5757
request_token_params={
5858
'scope': 'openid profile',
59-
'audience': AUTH0_AUDIENCE
59+
'audience': 'https://' + AUTH0_DOMAIN + '/userinfo'
6060
},
6161
base_url='https://%s' % AUTH0_DOMAIN,
6262
access_token_method='POST',
@@ -104,11 +104,9 @@ def callback_handling():
104104

105105
return redirect('/dashboard')
106106

107-
108107
@APP.route('/login')
109108
def login():
110-
return auth0.authorize(callback=AUTH0_CALLBACK_URL)
111-
109+
return auth0.authorize(callback=AUTH0_CALLBACK_URL if AUTH0_CALLBACK_URL is not '' else "http://localhost:3000/callback")
112110

113111
@APP.route('/logout')
114112
def logout():

0 commit comments

Comments
 (0)