insomnia/packages/insomnia-app/app/network/bearer-auth/get-header.js

9 lines
263 B
JavaScript
Raw Normal View History

// @flow
2018-06-25 17:42:50 +00:00
import type { RequestHeader } from '../../models/request';
2018-10-17 16:42:33 +00:00
export function getBearerAuthHeader(token: string, prefix: string): RequestHeader {
const name = 'Authorization';
const value = `${prefix || 'Bearer'} ${token}`;
2018-06-25 17:42:50 +00:00
return { name, value };
}