Auth still in progress

This commit is contained in:
Claude Brisson
2024-02-26 09:54:28 +01:00
parent 69d4a9c1e6
commit 71549f185e
27 changed files with 295 additions and 84 deletions

View File

@@ -19,9 +19,8 @@ let headers = function(withJson) {
if (withJson) {
ret['Content-Type'] = 'application/json';
}
let accessToken = store('accessToken');
if (accessToken) {
ret['Authorization'] = `Bearer ${accessToken}`;
if (apiToken) {
ret['Authorization'] = `Bearer ${apiToken}`;
}
return ret;
};

View File

@@ -45,6 +45,7 @@
<!-- error messages included as html elements so that they are translated -->
<div id="required_field" class="hidden">Required field</div>
<script type="text/javascript">
const apiToken = '$!api.bearer';
#if($tour)
const tour_id = ${tour.id};
const tour_rounds = ${tour.rounds};