mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-19 14:09:20 -04:00
Redirect signed-in users to their service
Some users are bookmarking the sign in page for quick access to their Notify service. If they’re already signed in when they used this bookmark they get redirected. However the redirect isn’t very smart, because it just takes them to their list of services. This isn’t great if they only have one service. This commit redirects them to the `show_accounts_or_dashboard` endpoint instead, which does the work to figure out which page is most useful to show someone when they sign in. Also changing this for `/register`, although it’s less likely that someone will have bookmarked this page.
This commit is contained in:
@@ -16,7 +16,7 @@ from app.main.views.verify import activate_user
|
||||
@main.route('/register', methods=['GET', 'POST'])
|
||||
def register():
|
||||
if current_user and current_user.is_authenticated:
|
||||
return redirect(url_for('main.choose_account'))
|
||||
return redirect(url_for('main.show_accounts_or_dashboard'))
|
||||
|
||||
form = RegisterUserForm()
|
||||
if form.validate_on_submit():
|
||||
|
||||
@@ -18,7 +18,7 @@ from app.main.forms import LoginForm
|
||||
@main.route('/sign-in', methods=(['GET', 'POST']))
|
||||
def sign_in():
|
||||
if current_user and current_user.is_authenticated:
|
||||
return redirect(url_for('main.choose_account'))
|
||||
return redirect(url_for('main.show_accounts_or_dashboard'))
|
||||
|
||||
form = LoginForm()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user