scim-mcp / src /utils /getSCIMToken.ts
chenhunghan's picture
fix: change to x-scim-api-token
fd4175d unverified
raw
history blame contribute delete
370 Bytes
type Headers = import("http").IncomingHttpHeaders;
export function getScimToken(headers: Headers): string {
let token = "";
if (process.env.SCIM_API_TOKEN) {
token = process.env.SCIM_API_TOKEN;
}
const tokenFromHeader = headers["x-scim-api-token"];
if (typeof tokenFromHeader === "string") {
token = tokenFromHeader.trim();
}
return token;
}