app-MAIL-temp/app/api/views/user_info.py

19 lines
375 B
Python
Raw Normal View History

2020-03-18 18:34:37 +01:00
from flask import jsonify, g
2020-01-05 22:48:38 +01:00
from flask_cors import cross_origin
from app.api.base import api_bp, verify_api_key
@api_bp.route("/user_info")
@cross_origin()
@verify_api_key
def user_info():
"""
Return user info given the api-key
"""
user = g.user
2020-03-18 18:34:37 +01:00
return jsonify(
{"name": user.name, "is_premium": user.is_premium(), "email": user.email}
)