From 0e6236ad1da45c4275af8b6937e9de92110e2d79 Mon Sep 17 00:00:00 2001 From: deflax Date: Sat, 6 Apr 2024 17:15:05 +0300 Subject: [PATCH] fix main.index redirect of oauth functions --- src/forest/auth/routes.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/forest/auth/routes.py b/src/forest/auth/routes.py index 7a6f363..3803654 100644 --- a/src/forest/auth/routes.py +++ b/src/forest/auth/routes.py @@ -16,7 +16,7 @@ import pyqrcode @auth.route('/authorize/') def oauth2_authorize(provider): if not current_user.is_anonymous: - return redirect(url_for('index')) + return redirect(url_for('main.index')) provider_data = current_app.config['OAUTH2_PROVIDERS'].get(provider) if provider_data is None: @@ -41,7 +41,7 @@ def oauth2_authorize(provider): @auth.route('/callback/') def oauth2_callback(provider): if not current_user.is_anonymous: - return redirect(url_for('index')) + return redirect(url_for('main.index')) provider_data = current_app.config['OAUTH2_PROVIDERS'].get(provider) if provider_data is None: @@ -52,7 +52,7 @@ def oauth2_callback(provider): for k, v in request.args.items(): if k.startswith('error'): flash(f'{k}: {v}') - return redirect(url_for('index')) + return redirect(url_for('main.index')) # make sure that the state parameter matches the one we created in the # authorization request