fix reset password - closes #1502

pull/1770/head
Diego Sampaio 10 years ago
parent decaf1305a
commit 19ca589b74
  1. 29
      packages/rocketchat-ui/lib/accounts.coffee
  2. 1
      packages/rocketchat-ui/package.js
  3. 2
      server/lib/accounts.coffee

@ -1,17 +1,16 @@
Meteor.startup ->
Accounts.onEmailVerificationLink (token, done) ->
Accounts.verifyEmail token, (error) ->
if not error?
alert(t('Email_verified'))
Accounts.onEmailVerificationLink (token, done) ->
Accounts.verifyEmail token, (error) ->
if not error?
alert(t('Email_verified'))
done()
done()
Accounts.onResetPasswordLink (token, done) ->
newPassword = prompt(t('New_password'))
Accounts.resetPassword token, newPassword, (error) ->
if error?
console.log error
alert(t('Error_changing_password'))
else
alert('Password_changed')
done()
Accounts.onResetPasswordLink (token, done) ->
newPassword = prompt(t('New_password'))
Accounts.resetPassword token, newPassword, (error) ->
if error?
console.log error
alert(t('Error_changing_password'))
else
alert('Password_changed')
done()

@ -14,6 +14,7 @@ Package.onUse(function(api) {
api.versionsFrom('1.2.1');
api.use([
'accounts-base',
'mongo',
'session',
'jquery',

@ -25,7 +25,7 @@ Accounts.emailTemplates.verifyEmail.text = (user, url) ->
resetPasswordText = Accounts.emailTemplates.resetPassword.text
Accounts.emailTemplates.resetPassword.text = (user, url) ->
url = url.replace Meteor.absoluteUrl(), Meteor.absoluteUrl() + 'login/'
verifyEmailText user, url
resetPasswordText user, url
if RocketChat.settings.get 'Accounts_Enrollment_Email'
Accounts.emailTemplates.enrollAccount.text = (user, url) ->

Loading…
Cancel
Save