mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-18 05:29:38 -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:
@@ -12,7 +12,7 @@ class Roles(db.Model):
|
||||
role = db.Column(db.String, nullable=False, unique=True)
|
||||
|
||||
|
||||
class Users(db.Model):
|
||||
class User(db.Model):
|
||||
__tablename__ = 'users'
|
||||
|
||||
id = db.Column(db.Integer, primary_key=True)
|
||||
@@ -63,7 +63,7 @@ class Users(db.Model):
|
||||
|
||||
@staticmethod
|
||||
def load_user(user_id):
|
||||
user = Users.query.filter_by(id=user_id).first()
|
||||
user = User.query.filter_by(id=user_id).first()
|
||||
if user.is_active():
|
||||
return user
|
||||
|
||||
|
||||
Reference in New Issue
Block a user