mirror of
https://github.com/verdaccio/verdaccio.git
synced 2025-01-06 22:40:26 -05:00
e367c3f1e0
* feat: improve legacy token signature by removing deprecated crypto.createDecipher * fix: wrong reference * chore: add debug
13 lines
331 B
TypeScript
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 };
|
|
}
|