More meaningful authentication JSON
This commit is contained in:
parent
0edd55b64e
commit
4a92b057e8
|
@ -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'])
|
||||||
|
|
Loading…
Reference in New Issue