Skip to content

Commit

Permalink
slash
Browse files Browse the repository at this point in the history
  • Loading branch information
eliobischof committed Feb 21, 2025
1 parent 1b1ecca commit 31d15ab
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
*
/*
!/docker
8 changes: 0 additions & 8 deletions apps/login/next-env-vars.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,6 @@ declare namespace NodeJS {
*/
ZITADEL_API_URL: string;

/**
* Takes effect only if ZITADEL_API_URL is not empty.
* This is only relevant if Zitadels runtime has the ZITADEL_INSTANCEHOSTHEADERS config changed.
* The default is x-zitadel-instance-host.
* Most users don't need to set this variable.
*/
ZITADEL_INSTANCE_HOST_HEADER: string;

/**
* Self hosting: The service user id
*/
Expand Down
20 changes: 1 addition & 19 deletions apps/login/src/lib/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,26 +42,8 @@ export async function createServiceForHost<T extends ServiceClass>(
throw new Error("No token found");
}

const instanceHost = new URL(serviceUrl).host;
const transport = createServerTransport(token, {
baseUrl: process.env.ZITADEL_API_URL ?? serviceUrl,
interceptors:
(process.env.ZITADEL_API_URL &&
process.env.ZITADEL_API_URL != serviceUrl) ||
process.env.ZITADEL_INSTANCE_HOST_HEADER
? [
(next) => {
return (req) => {
req.header.set(
process.env.ZITADEL_INSTANCE_HOST_HEADER ??
"x-zitadel-instance-host",
instanceHost,
);
return next(req);
};
},
]
: undefined,
baseUrl: serviceUrl,
});

return createClientFor<T>(service)(transport);
Expand Down

0 comments on commit 31d15ab

Please sign in to comment.