insomnia/packages/insomnia-app/app/network/bearer-auth/get-header.js
2018-10-17 12:42:33 -04:00

9 lines
263 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 };
}