mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-24 00:07:02 -04:00
108536490: Implement LoginManager for the admin app.
Also added csrf error handler, will make the session unauthorized if the csrf token is invalid.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
from app import db
|
||||
from app.models import Users
|
||||
from app.models import User
|
||||
from app.main.encryption import encrypt
|
||||
|
||||
|
||||
@@ -10,12 +10,12 @@ def insert_user(user):
|
||||
|
||||
|
||||
def get_user_by_id(id):
|
||||
return Users.query.filter_by(id=id).first()
|
||||
return User.query.filter_by(id=id).first()
|
||||
|
||||
|
||||
def get_all_users():
|
||||
return Users.query.all()
|
||||
return User.query.all()
|
||||
|
||||
|
||||
def get_user_by_email(email_address):
|
||||
return Users.query.filter_by(email_address=email_address).first()
|
||||
return User.query.filter_by(email_address=email_address).first()
|
||||
|
||||
Reference in New Issue
Block a user