From 3e2491a9bc6579ccf017f0dbc2573b5ab4c75613 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sat, 21 Jan 2023 08:36:25 +0100 Subject: API documentation: do not perform database requests from template helpers --- templates/api_documentation.html.ep | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'templates/api_documentation.html.ep') diff --git a/templates/api_documentation.html.ep b/templates/api_documentation.html.ep index 55cd54a..c9125a2 100644 --- a/templates/api_documentation.html.ep +++ b/templates/api_documentation.html.ep @@ -1,10 +1,6 @@ % my $api_root = $self->url_for('/api/v1')->to_abs->scheme('https'); -% my $token = {}; -% my $uid; -% if (is_user_authenticated()) { - % $uid = current_user()->{id}; - % $token = get_api_token(); -% } +% my $token = stash('api_token') // {}; +% my $uid = stash('uid') // q{};

API

-- cgit v1.2.3