Aldeed:autoform login and register

Hello guys is it possible to login and register an user based on aldeed:autoform? I tried with accounts-base, accounts-password ,useraccounts:unstyled, but I did not succeed at all because of the fields I need to add as date, in order to get the person’s age. I tried to use
Accounts.createUser to add the
<input id="create-user-date" type="date" name="date" value="date">
but I did not have any success at all. I couldn’t save the information to be able to log in.

If they have an example I would thank them both ways they serve me (aldeed: autoform or useraccounts: unstyled).

Hi Marcel,

I use and would recommend this project for account management:

Hello thanks for replying, if in effect I already use it as I mentioned use useraccounts-unstyled but to add the date fields as I want it does not work for me only very limited fields like these password-email-text-tel- url-checkbox-select-radio-hidden I need a type date.

I use autoform for my login and signup forms. You just need a to add a form submission hook:

const logInSchema = new SimpleSchema({
  email: {
    label: 'Email',
    type: String,
    regEx: SimpleSchema.RegEx.Email
  },
  password: {
    type: String,
    label: "Enter a password",
    min: 8,
    autoform: {
      type: 'password'
    }
  }
});

AutoForm.addHooks('logInForm', {
      onSubmit: function (formFields, updateDoc, currentDoc) {
        Meteor.loginWithPassword(formFields.email, formFields.password, (error) => {
          if (error) { //TODO: dry with signup
            instance.errorText.set(error.reason);
            this.done(error);
          } else {
            this.done();
          }
        });
        return false;
      }
    });

Then if you are using to blaze to react library:

<div>
  <Blaze template="quickForm" schema={logInSchema} id="logInForm" buttonContent="Log In"/>
</div>

Or, vanilla blaze:

{{> quickForm schema="logInSchema" id="logInForm" buttonContent="Log In"}}
1 Like

S[quote=“wesleyfsmith, post:4, topic:33375”]
In"}}
[/quote]

Hi thanks for answer, thats for my login right? It is possible with loginwhitpassword to create an account with an id and valid user I have understood that Accounts.createUser should be used.

Yes, just substitute loginWithPassword with Accounts.createUser and it should work fine.

Ok thanks again let me try to see how this works for me.

Hello friend to send a welcome email when you register and when a user forgets the password as you do? I have been following the official meteor documentation but I have not been successful. I have only managed to send me an email forgetting password with my account validated by amazon. If you have any examples working, I would appreciate it.

How to wait on Meteor.call(.....) of onSubmit, if the method do a log time.
onSuccess run don’t wait onSubmit, but immediately it show error msg too.

AutoForm.addHooks('logInForm', {
      onSubmit: function (formFields, updateDoc, currentDoc) {
        Meteor.loginWithPassword(formFields.email, formFields.password, (error) => {
          if (error) { //TODO: dry with signup
            instance.errorText.set(error.reason);
            this.done(error);
          } else {
            this.done();
          }
        });
        return false;
      },

      onSuccess: (){
          ..........
      }
    });

And then why you can use instance...., because AutoForm.addHooks is out the Template Level.

@marcelrama Sorry, I haven’t implemented any use flow with email yet!