Function
basicAuth
(user: string, token: string)
Source from the content-addressed store, hash-verified
| 14 | // bitbucket.org: Basic base64("x-token-auth:" + TOKEN) (app password: user:app_password) |
| 15 | // generic Gitea: Basic base64(username + ":" + TOKEN) |
| 16 | export function basicAuth(user: string, token: string): string { |
| 17 | return "Basic " + btoa(`${user}:${token}`); |
| 18 | } |
| 19 | |
| 20 | export function authForHost(host: string, token?: string): AuthRecipe { |
| 21 | if (!token) return {}; |
Tested by
no test coverage detected