3 const AuthPrompt = require('../types/auth');
5 function defaultAuthenticate(value, state) {
6 if (value.username === this.options.username && value.password === this.options.password) {
12 const factory = (authenticate = defaultAuthenticate) => {
14 { name: 'username', message: 'username' },
19 if (this.options.showPassword) {
22 let color = this.state.submitted ? this.styles.primary : this.styles.muted;
23 return color(this.symbols.asterisk.repeat(input.length));
28 class BasicAuthPrompt extends AuthPrompt.create(authenticate) {
29 constructor(options) {
30 super({ ...options, choices });
33 static create(authenticate) {
34 return factory(authenticate);
38 return BasicAuthPrompt;
41 module.exports = factory();