meteor-useraccounts / materialize

Accounts Templates styled for Materialize.
http://useraccounts.meteor.com/
MIT License
49 stars 26 forks source link

Change Password does not work (always: "Passwords don't match") #9

Closed derwok closed 9 years ago

derwok commented 9 years ago

When I use

    {{#if currentUser}}
      {{> atForm state='changePwd'}}
       // ....

I get a cool looking password change dialog like in the attached image. changepassword

The dialog has two text inputs:

I entered almost 10 times password pairs that exactly machted (trust me!). But I get the error "Password (again): Passwords don't match". On the server I get this log:

I20150409-21:41:09.200(2)? Exception while invoking method 'changePassword' Error: Match error: Failed Match.OneOf or Match.Optional validation
I20150409-21:41:09.200(2)?     at checkSubtree (packages/check/match.js:244:1)
I20150409-21:41:09.205(2)?     at check (packages/check/match.js:32:1)
I20150409-21:41:09.206(2)?     at [object Object].Meteor.methods.changePassword (packages/accounts-password/password_server.js:272:1)
I20150409-21:41:09.206(2)?     at maybeAuditArgumentChecks (packages/ddp/livedata_server.js:1617:1)
I20150409-21:41:09.206(2)?     at packages/ddp/livedata_server.js:648:1
I20150409-21:41:09.206(2)?     at [object Object]._.extend.withValue (packages/meteor/dynamics_nodejs.js:56:1)
I20150409-21:41:09.206(2)?     at packages/ddp/livedata_server.js:647:1
I20150409-21:41:09.206(2)?     at [object Object]._.extend.withValue (packages/meteor/dynamics_nodejs.js:56:1)
I20150409-21:41:09.206(2)?     at [object Object]._.extend.protocol_handlers.method (packages/ddp/livedata_server.js:646:1)
I20150409-21:41:09.206(2)?     at packages/ddp/livedata_server.js:546:1
I20150409-21:41:09.206(2)? Sanitized and reported to the client as: Match failed [400]

When I look into packages/accounts-password/password_server.js:272:1 I see this line:

Meteor.methods({changePassword: function (oldPassword, newPassword) {

So it seems the framework need also the old password (which makes sense!).

Finally I think there is a bug here in the materilaized dialog where an entry field for the old password is missing...

Can anybody help?

splendido commented 9 years ago

Hi @derwok!

There must be a bug, for sure! Lets have a look at the change password page (being logged in...): it seems all is working correctly.

Could you confirm configuring the change password route works fine also for you? Then I'll try to dig it a little more...

Thanks!

splendido commented 9 years ago

@derwok, I've quickly tested {{> atForm state='changePwd'}} locally and everything seems fine from my side...

Are you using the latest version useraccounts:materialize@1.8.1?

ghost commented 8 years ago

I got the same problem. My solution is: AccountsTemplates.configure({ ... enablePasswordChange: true, ... })

splendido commented 8 years ago

thanks for reporting @django43ru!

ghost commented 8 years ago

I hope, it'll be usefull)

btbjosh commented 8 years ago

That was the fix I needed! Thanks!