eris/utils/getAuthHeader.ts

5 lines
187 B
TypeScript
Raw Permalink Normal View History

2023-10-13 11:47:57 +00:00
export function getAuthHeader(auth: { user: string; password: string } | null) {
if (!auth) return {};
return { "Authorization": `Basic ${btoa(`${auth.user}:${auth.password}`)}` };
}