diff --git a/src/anonchat/admin_routes.py b/src/anonchat/admin_routes.py index dd39691..6c5e96f 100644 --- a/src/anonchat/admin_routes.py +++ b/src/anonchat/admin_routes.py @@ -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)