fix
This commit is contained in:
parent
67f43d95af
commit
129cb99673
1 changed files with 3 additions and 2 deletions
|
|
@ -49,6 +49,7 @@ export async function authorizeRequestWebHandler(request, reply) {
|
||||||
const record = await getAndValidateStateOfRequest(request);
|
const record = await getAndValidateStateOfRequest(request);
|
||||||
const url = new URL(request.url, `http://${request.headers.host}`);
|
const url = new URL(request.url, `http://${request.headers.host}`);
|
||||||
const callbackUrl = url.searchParams.get("callbackUrl");
|
const callbackUrl = url.searchParams.get("callbackUrl");
|
||||||
|
const baseUrl = new URL(request.url).pathname?.split('/')?.[1] || '';
|
||||||
|
|
||||||
const method = record.method;
|
const method = record.method;
|
||||||
let nip05: string | undefined;
|
let nip05: string | undefined;
|
||||||
|
|
@ -59,7 +60,7 @@ export async function authorizeRequestWebHandler(request, reply) {
|
||||||
const [ username, domain, email ] = JSON.parse(record.params!);
|
const [ username, domain, email ] = JSON.parse(record.params!);
|
||||||
nip05 = `${username}@${domain}`;
|
nip05 = `${username}@${domain}`;
|
||||||
|
|
||||||
return reply.view("/templates/createAccount.handlebar", { record, email, username, domain, nip05, callbackUrl });
|
return reply.view("/templates/createAccount.handlebar", { baseUrl, record, email, username, domain, nip05, callbackUrl });
|
||||||
} else {
|
} else {
|
||||||
const authorized = validateAuthCookie(request);
|
const authorized = validateAuthCookie(request);
|
||||||
return reply.view("/templates/authorizeRequest.handlebar", { record, callbackUrl, authorized });
|
return reply.view("/templates/authorizeRequest.handlebar", { record, callbackUrl, authorized });
|
||||||
|
|
@ -163,7 +164,7 @@ export async function processRegistrationWebHandler(request, reply) {
|
||||||
try {
|
try {
|
||||||
const record = await getAndValidateStateOfRequest(request);
|
const record = await getAndValidateStateOfRequest(request);
|
||||||
const body = request.body;
|
const body = request.body;
|
||||||
const baseUrl = new URL(request.url).pathname.split('/')[1];
|
const baseUrl = new URL(request.url).pathname?.split('/')?.[1] || '';
|
||||||
|
|
||||||
// we serialize the payload again and store it
|
// we serialize the payload again and store it
|
||||||
// along with the allowed flag
|
// along with the allowed flag
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue