mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-24 00:07:02 -04:00
108536490: Initial effort to implement log in
Add endpoint for post to /sign-in Initialise role data
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
from app import db
|
||||
from app.models import Users
|
||||
from app.main.encryption import encrypt
|
||||
|
||||
|
||||
def insert_user(user):
|
||||
user.password = encrypt(user.password)
|
||||
db.session.add(user)
|
||||
db.session.commit()
|
||||
|
||||
@@ -13,3 +15,7 @@ def get_user_by_id(id):
|
||||
|
||||
def get_all_users():
|
||||
return Users.query.all()
|
||||
|
||||
|
||||
def get_user_by_email(email_address):
|
||||
return Users.query.filter_by(email_address=email_address).first()
|
||||
|
||||
Reference in New Issue
Block a user