3 const FormPrompt = require('../prompts/form');
5 const defaultAuthenticate = () => {
6 throw new Error('expected prompt to have a custom authenticate method');
9 const factory = (authenticate = defaultAuthenticate) => {
11 class AuthPrompt extends FormPrompt {
12 constructor(options) {
17 this.value = await authenticate.call(this, this.values, this.state);
18 super.base.submit.call(this);
21 static create(authenticate) {
22 return factory(authenticate);
29 module.exports = factory();