0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2025-01-06 22:40:26 -05:00
verdaccio/packages/auth/src/token.ts
Juan Picado e367c3f1e0 feat: improve legacy token signature by removing deprecated crypto.cr… (#1953)
* feat: improve legacy token signature by removing deprecated crypto.createDecipher

* fix: wrong reference

* chore: add debug
2021-04-09 17:54:21 +02:00

13 lines
331 B
TypeScript

import { BasicPayload } from './utils';
export function parseBasicPayload(credentials: string): BasicPayload {
const index = credentials.indexOf(':');
if (index < 0) {
return;
}
const user: string = credentials.slice(0, index);
const password: string = credentials.slice(index + 1);
return { user, password };
}