This commit is contained in:
Minecon724 2025-04-03 09:26:23 +02:00
commit 058e1dbcc1
Signed by: Minecon724
GPG key ID: A02E6E67AB961189

View file

@ -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)