mirror of https://github.com/veypi/OneAuth.git
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.
8 lines
264 B
TypeScript
8 lines
264 B
TypeScript
|
2 years ago
|
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}`;
|
||
|
|
}
|