0
votes

User gets an Tokenised URL to his EMAIL reset password. URL is sent from Server side. Now when User hits URL, he is navigated to Reset password screes at CLIENT side.

When user enter password , and click Reset button. I am Calling "Reset password" method present at server side using meter.call(). I want to pass Token and new password to that function as input. how can i get that token which was generated at Server side to Client side.

Present i am getting this error : Token Undefined

1
Instead of a Meteor.call, you can use Accounts.resetPassword on the client side. - aedm
aedm : i am using this meteor.call('Accounts.resetPassword', token,pass) ; As my Accounts.resetPassword method is at server side. I got to know that server side methods are called using meteor.call() - Bharat Dungerwal
Try Accounts.resetPassword(token, pass); without Meteor.call. See: docs.meteor.com/api/passwords.html#Accounts-resetPassword - aedm
I wil be able to call server side function fromClient using this? - Bharat Dungerwal
You don't need to call a server-side function here, Accounts.resetPassword does it for you. - aedm

1 Answers

0
votes

Since you're dealing with a tokenised URL, you could figure out some way to parse the URL to retrieve the token. Getting the current URL is just:

document.URL

This could be even easier if you used Iron Router, as you could use this.params to find the token you stored inside the URL.