Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

auth.js 606B

1234567891011121314151617181920212223242526272829
  1. 'use strict';
  2. const FormPrompt = require('../prompts/form');
  3. const defaultAuthenticate = () => {
  4. throw new Error('expected prompt to have a custom authenticate method');
  5. };
  6. const factory = (authenticate = defaultAuthenticate) => {
  7. class AuthPrompt extends FormPrompt {
  8. constructor(options) {
  9. super(options);
  10. }
  11. async submit() {
  12. this.value = await authenticate.call(this, this.values, this.state);
  13. super.base.submit.call(this);
  14. }
  15. static create(authenticate) {
  16. return factory(authenticate);
  17. }
  18. }
  19. return AuthPrompt;
  20. };
  21. module.exports = factory();