mirror of
https://github.com/kind-0/nsecbunkerd.git
synced 2026-05-03 07:00:11 +00:00
pass url prefix to handlebar
This commit is contained in:
parent
f3b8aa8ebb
commit
bc28858146
@ -174,13 +174,15 @@ class Daemon {
|
|||||||
async startWebAuth() {
|
async startWebAuth() {
|
||||||
if (!this.config.authPort) return;
|
if (!this.config.authPort) return;
|
||||||
|
|
||||||
const prefix = new URL(this.config.baseUrl as string).pathname.replace(/\/+$/, '');
|
const urlPrefix = new URL(this.config.baseUrl as string).pathname.replace(/\/+$/, '');
|
||||||
|
|
||||||
this.fastify.register(FastifyView, {
|
this.fastify.register(FastifyView, {
|
||||||
engine: {
|
engine: {
|
||||||
handlebars: Handlebars
|
handlebars: Handlebars,
|
||||||
},
|
},
|
||||||
prefix
|
defaultContext: {
|
||||||
|
urlPrefix
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
this.fastify.listen({ port: this.config.authPort });
|
this.fastify.listen({ port: this.config.authPort });
|
||||||
|
|||||||
@ -87,7 +87,7 @@
|
|||||||
</h1>
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
<form
|
<form
|
||||||
action="/register/{{record.id}}"
|
action="{{urlPrefix}}/register/{{record.id}}"
|
||||||
method="POST"
|
method="POST"
|
||||||
class="w-full flex flex-col gap-5">
|
class="w-full flex flex-col gap-5">
|
||||||
{{#if error}}
|
{{#if error}}
|
||||||
|
|||||||
@ -52,7 +52,7 @@
|
|||||||
</h1>
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
<form
|
<form
|
||||||
action="/login"
|
action="{{urlPrefix}}/login"
|
||||||
method="POST"
|
method="POST"
|
||||||
class="w-full flex flex-col gap-5">
|
class="w-full flex flex-col gap-5">
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user