Skip to content

Commit

Permalink
fix: unauthorized page is not html
Browse files Browse the repository at this point in the history
  • Loading branch information
bytemain committed Sep 27, 2023
1 parent 9afcb1a commit 6713429
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/api/controllers/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export function route(hono: THono) {
}

console.log('Unauthorized', token, id);
return c.html(html`${UnauthorizedHTML}`, 401);
return c.html(UnauthorizedHTML, 401);
});

hono.get('/configuration/:id', async (c) => {
Expand Down Expand Up @@ -121,18 +121,18 @@ export function route(hono: THono) {

return c.html(
ConfigurationHTML +
`
<script type="module">
import defaultSchema from '${schemaUrl}' assert { type: 'json' };
window.starting_value = ${JSON.stringify(data ?? {})};
window.submit_url = '${c.origin}configuration/${id}/${type}?token=${token}';
window._options = {
schema: defaultSchema,
startval: window.starting_value,
}
window.parseData();
</script>`,
html` <script type="module">
import defaultSchema from '${schemaUrl}' assert { type: 'json' };
window.starting_value = ${JSON.stringify(data ?? {})};
window.submit_url =
'${c.origin}configuration/${id}/${type}?token=${token}';
window._options = {
schema: defaultSchema,
startval: window.starting_value,
};
window.parseData();
</script>`,
);
});
}

0 comments on commit 6713429

Please sign in to comment.