mirror of
https://github.com/simple-login/app.git
synced 2024-11-16 08:58:30 +01:00
18 lines
375 B
Python
18 lines
375 B
Python
from flask import jsonify, g
|
|
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
|
|
|
|
return jsonify(
|
|
{"name": user.name, "is_premium": user.is_premium(), "email": user.email}
|
|
)
|