Disable password field for registration

How disable password field for registration (create-account) ?

1 Like

On a regular sign up I don’t think you can :thinking: But you can set up one click install with google, twitter, facebook, etc, you won’t have password to set up.

You wanted something like wordpress where you receive a generated password via email?

2 Likes

yes, as in wordpress :+1:

1 Like

delete field in *.hbs
and

import CreateAccount from 'discourse/controllers/create-account';
import PasswordValidation from 'discourse/mixins/password-validation';
import {ajax} from 'discourse/lib/ajax';
import {escapeExpression} from 'discourse/lib/utilities';
import {extractError} from 'discourse/lib/ajax-error';

export default {
  name: 'Create-Account-Popup',
  initialize: function () {

    PasswordValidation.reopen({
        passwordValidation: function() {
            return EmberObject.create({ ok: true });
        }
      });

    CreateAccount.reopen({

      actions: {
        createAccount() {
            console.log(' createAccount !!');
            if (new Date() - this._challengeDate > 1000 * this._challengeExpiry) {
              this.fetchConfirmationValue().then(() =>
                this.performAccountCreation()
              );
            } else {
              this.performAccountCreation();
            }
          }
      }
    });


  }
}
1 Like