Skip to content
Snippets Groups Projects
Commit 19ca589b authored by Diego Sampaio's avatar Diego Sampaio
Browse files

fix reset password - closes #1502

parent decaf130
No related branches found
No related tags found
No related merge requests found
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()
\ No newline at end of file
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) ->
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment