wiki-grav/plugins/login/templates/login.json.twig

5 lines
301 B
Twig
Raw Normal View History

{%- if not grav.user.authenticated -%}
{"code":401,"status":"unauthenticated","error":{"message":"Authentication required","login":{{ include('partials/login-form.html.twig')|trim|json_encode }}}}
{%- else -%}
{"code":200,"status":"authenticated","message":"You have been authenticated"}
{%- endif -%}