From 7c0d609b80694b09b3e78edd291182db10c57185 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Gr=C3=B6ger?= Date: Wed, 27 Jan 2021 13:52:12 +0100 Subject: [PATCH] change return of set_lifetime os session sry i've not configured black to line_width=120 --- flaschengeist/plugins/auth/__init__.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/flaschengeist/plugins/auth/__init__.py b/flaschengeist/plugins/auth/__init__.py index 1ca0ad8..853902c 100644 --- a/flaschengeist/plugins/auth/__init__.py +++ b/flaschengeist/plugins/auth/__init__.py @@ -50,7 +50,11 @@ def login(): # Lets cleanup the DB 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"]) @@ -135,9 +139,11 @@ def set_lifetime(token, current_session, **kwargs): raise Forbidden try: 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) - return "", NO_CONTENT + return jsonify(sessionController.get_session(token, current_session._user)) except (KeyError, TypeError): raise BadRequest