diff --git a/src/resources/non_entities/sessions_endpoints.py b/src/resources/non_entities/sessions_endpoints.py index ac3e255e..2b4f2141 100644 --- a/src/resources/non_entities/sessions_endpoints.py +++ b/src/resources/non_entities/sessions_endpoints.py @@ -6,6 +6,7 @@ from common.database_helpers import insert_row_into_table, delete_row_by_id, get_row_by_id from common.helpers import get_session_id_from_auth_header, requires_session_id, queries_records from common.models.db_models import SESSION +import datetime class Sessions(Resource): @@ -54,7 +55,7 @@ def post(self): return "Bad request", 400 if request.json["username"] == "user" and request.json["password"] == "password": session_id = str(uuid.uuid1()) - insert_row_into_table(SESSION, SESSION(ID=session_id)) + insert_row_into_table(SESSION, SESSION(ID=session_id, USERNAME="simple/root", EXPIREDATETIME=datetime.datetime.now() + datetime.timedelta(days=1))) return {"sessionID": session_id}, 201 return "Forbidden", 403