You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
OneAuth/oaweb/src/libs/webdav/auth/basic.ts

8 lines
264 B
TypeScript

import { toBase64 } from "../tools/encode";
import { AuthHeader } from "../types";
export function generateBasicAuthHeader(username: string, password: string): AuthHeader {
const encoded = toBase64(`${username}:${password}`);
return `Basic ${encoded}`;
}