insomnia/packages/insomnia-app/app/network/bearer-auth/get-header.js
Gregory Schier 4901f03041 Add Prettier
2018-06-25 13:42:50 -04:00

12 lines
269 B
JavaScript

// @flow
import type { RequestHeader } from '../../models/request';
export function getBearerAuthHeader(
token: string,
prefix: string
): RequestHeader {
const name = 'Authorization';
const value = `${prefix || 'Bearer'} ${token}`;
return { name, value };
}