no return needed, redirect throws
This commit is contained in:
parent
1af14a5db4
commit
57cf3bd7d6
10
frontend.py
10
frontend.py
|
@ -54,7 +54,7 @@ def confirm(token):
|
||||||
# create db-entry
|
# create db-entry
|
||||||
if db.confirm(token):
|
if db.confirm(token):
|
||||||
# :todo show info "Account creation successful."
|
# :todo show info "Account creation successful."
|
||||||
return redirect('/settings')
|
redirect('/settings')
|
||||||
return dict(error='Email confirmation failed.')
|
return dict(error='Email confirmation failed.')
|
||||||
|
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ def login_post():
|
||||||
try:
|
try:
|
||||||
if db.by_email(request.forms.get('email', '')) \
|
if db.by_email(request.forms.get('email', '')) \
|
||||||
.check_password(request.forms.get('pass', '')):
|
.check_password(request.forms.get('pass', '')):
|
||||||
return redirect('/settings')
|
redirect('/settings')
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
pass
|
pass
|
||||||
return dict(error='Authentication failed.')
|
return dict(error='Authentication failed.')
|
||||||
|
@ -92,7 +92,7 @@ def logout():
|
||||||
# clear auth cookie
|
# clear auth cookie
|
||||||
response.set_cookie('uid', '', expires=0, path="/")
|
response.set_cookie('uid', '', expires=0, path="/")
|
||||||
# :todo show info "Logout successful."
|
# :todo show info "Logout successful."
|
||||||
return redirect('/')
|
redirect('/')
|
||||||
|
|
||||||
|
|
||||||
@get('/login/twitter')
|
@get('/login/twitter')
|
||||||
|
@ -112,7 +112,7 @@ def login_twitter(user):
|
||||||
exc_info=True)
|
exc_info=True)
|
||||||
return dict(error="Failed to get request token.")
|
return dict(error="Failed to get request token.")
|
||||||
user.save_request_token(auth.request_token)
|
user.save_request_token(auth.request_token)
|
||||||
return bottle.redirect(redirect_url)
|
redirect(redirect_url)
|
||||||
|
|
||||||
|
|
||||||
@get('/login/twitter/callback')
|
@get('/login/twitter/callback')
|
||||||
|
@ -131,7 +131,7 @@ def twitter_callback(user):
|
||||||
"oauth_token_secret": verifier}
|
"oauth_token_secret": verifier}
|
||||||
auth.get_access_token(verifier)
|
auth.get_access_token(verifier)
|
||||||
user.save_twitter_token(auth.access_token, auth.access_token_secret)
|
user.save_twitter_token(auth.access_token, auth.access_token_secret)
|
||||||
return bottle.redirect("/settings")
|
redirect("/settings")
|
||||||
|
|
||||||
|
|
||||||
@post('/login/mastodon')
|
@post('/login/mastodon')
|
||||||
|
|
Loading…
Reference in a new issue