change return of set_lifetime os session

sry i've not configured black to line_width=120
This commit is contained in:
Tim Gröger 2021-01-27 13:52:12 +01:00
parent 9eca15d036
commit 7c0d609b80
1 changed files with 9 additions and 3 deletions

View File

@ -50,7 +50,11 @@ def login():
# Lets cleanup the DB # Lets cleanup the DB
sessionController.clear_expired() sessionController.clear_expired()
return {"session": session, "user": user, "permissions": user.get_permissions()}, CREATED return {
"session": session,
"user": user,
"permissions": user.get_permissions(),
}, CREATED
@auth_bp.route("/auth", methods=["GET"]) @auth_bp.route("/auth", methods=["GET"])
@ -135,9 +139,11 @@ def set_lifetime(token, current_session, **kwargs):
raise Forbidden raise Forbidden
try: try:
lifetime = request.get_json()["value"] lifetime = request.get_json()["value"]
logger.debug("set lifetime {{ {} }} to access token {{ {} }}".format(lifetime, token)) logger.debug(
"set lifetime {{ {} }} to access token {{ {} }}".format(lifetime, token)
)
sessionController.set_lifetime(session, lifetime) sessionController.set_lifetime(session, lifetime)
return "", NO_CONTENT return jsonify(sessionController.get_session(token, current_session._user))
except (KeyError, TypeError): except (KeyError, TypeError):
raise BadRequest raise BadRequest