fix main.index redirect of oauth functions
This commit is contained in:
parent
c05e2f77f3
commit
0e6236ad1d
1 changed files with 3 additions and 3 deletions
|
@ -16,7 +16,7 @@ import pyqrcode
|
|||
@auth.route('/authorize/<provider>')
|
||||
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/<provider>')
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue