app-MAIL-temp/app/api/views/user_info.py
2020-06-24 10:30:01 +02:00

21 lines
415 B
Python

from flask import jsonify, g
from app.api.base import api_bp, require_api_auth
@api_bp.route("/user_info")
@require_api_auth
def user_info():
"""
Return user info given the api-key
"""
user = g.user
return jsonify(
{
"name": user.name,
"is_premium": user.is_premium(),
"email": user.email,
"in_trial": user.in_trial(),
}
)