mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-05 10:53:28 -05:00
Login user after they register
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
from datetime import datetime
|
||||
|
||||
from flask import render_template, redirect, jsonify
|
||||
from flask_login import login_user
|
||||
|
||||
from app.main import main
|
||||
from app.main.dao import users_dao
|
||||
@@ -26,6 +27,7 @@ def process_register():
|
||||
role_id=1)
|
||||
try:
|
||||
users_dao.insert_user(user)
|
||||
login_user(user)
|
||||
return redirect('/two-factor')
|
||||
except Exception as e:
|
||||
return jsonify(database_error=e.message), 400
|
||||
|
||||
@@ -44,7 +44,7 @@ def test_should_return_400_if_password_is_blacklisted(notifications_admin, notif
|
||||
data={'name': 'Bad Mobile',
|
||||
'email_address': 'bad_mobile@example.not.right',
|
||||
'mobile_number': '+44123412345',
|
||||
'password': 'password'})
|
||||
'password': 'password1234'})
|
||||
|
||||
response.status_code == 400
|
||||
assert 'That password is blacklisted, too common' in response.get_data(as_text=True)
|
||||
assert 'That password is blacklisted, too common' in response.get_data(as_text=True)
|
||||
|
||||
Reference in New Issue
Block a user