More meaningful authentication JSON

This commit is contained in:
Ferdinand Thiessen 2020-09-06 22:33:27 +02:00
parent 0edd55b64e
commit 4a92b057e8
1 changed files with 1 additions and 3 deletions

View File

@ -51,13 +51,11 @@ def _create_token():
logger.debug("user is {{ {} }}".format(user)) logger.debug("user is {{ {} }}".format(user))
token = access_controller.create(user, user_agent=request.user_agent) token = access_controller.create(user, user_agent=request.user_agent)
logger.debug("access token is {{ {} }}".format(token)) logger.debug("access token is {{ {} }}".format(token))
dic = user.serialize()
dic["access_token"] = token.token
logger.info("User {{ {} }} success login.".format(username)) logger.info("User {{ {} }} success login.".format(username))
# Lets cleanup the DB # Lets cleanup the DB
access_controller.clear_expired() access_controller.clear_expired()
return jsonify(dic) return jsonify({"user": user, "token": token.token})
@auth_bp.route("/auth", methods=['GET']) @auth_bp.route("/auth", methods=['GET'])