Closed AppleBoiy closed 4 months ago
Can I custom the default response for a specific endpoint?
normally when login success the response will be like this:
{ "meta": { "code": 200 }, "response": { "csrf_token": "token", } }
so, after login process success, I want to add some user data to the response, like this:
{ "meta": { "code": 200 }, "response": { "csrf_token": "token", "user": { "id": 1, "name": "John Doe", "email": "example@mail.com" } } }
Check out https://flask-security-too.readthedocs.io/en/stable/models.html#custom-user-payload
Also - in the future - please ask questions over in Discussions (on github). Thanks
Can I custom the default response for a specific endpoint?
normally when login success the response will be like this:
so, after login process success, I want to add some user data to the response, like this: