mirror of
https://github.com/simple-login/app.git
synced 2024-09-03 17:11:29 +02:00
24 lines
467 B
Python
24 lines
467 B
Python
from flask import jsonify, g
|
|
from flask_cors import cross_origin
|
|
|
|
from app.api.base import api_bp, require_api_auth
|
|
|
|
|
|
@api_bp.route("/user_info")
|
|
@cross_origin()
|
|
@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(),
|
|
}
|
|
)
|