mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-24 20:26:24 +00:00
Rename files
This commit is contained in:
18
ts/util/getBasicAuth.std.ts
Normal file
18
ts/util/getBasicAuth.std.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
// Copyright 2020 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { fromString, toBase64 } from '../Bytes.std.js';
|
||||
|
||||
export type GetBasicAuthOptionsType = Readonly<{
|
||||
username: string;
|
||||
password: string;
|
||||
}>;
|
||||
|
||||
export function getBasicAuth({
|
||||
username,
|
||||
password,
|
||||
}: GetBasicAuthOptionsType): string {
|
||||
const auth = toBase64(fromString(`${username}:${password}`));
|
||||
|
||||
return `Basic ${auth}`;
|
||||
}
|
||||
Reference in New Issue
Block a user