Fix
This commit is contained in:
parent
42c3c0d89a
commit
058e1dbcc1
1 changed files with 4 additions and 1 deletions
|
@ -56,7 +56,10 @@ def admin_oauth_login():
|
|||
@limiter.limit("10 per hour")
|
||||
def admin_oauth_callback():
|
||||
token = oauth.auth0.authorize_access_token()
|
||||
print(token)
|
||||
if token['userinfo']['sub'] != os.environ.get('ADMIN_ID'):
|
||||
flash('You are not authorized to access this application')
|
||||
return redirect(url_for('admin_login'))
|
||||
|
||||
session["user"] = token
|
||||
next_page = request.args.get('next') or url_for('admin_dashboard')
|
||||
return redirect(next_page)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue