Skip to content

Reset password - email won't send #5232

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
trondkr opened this issue Dec 11, 2018 · 2 comments
Closed

Reset password - email won't send #5232

trondkr opened this issue Dec 11, 2018 · 2 comments

Comments

@trondkr
Copy link

trondkr commented Dec 11, 2018

I have the same exact problem as mentioned here, but the issue was closed and not resolved. I have setup my Parse server (v3.1.2) on Elastic Beanstalk and everything is working well. I have setup "reset email" and "verify email" using my Mailgun account and the parse-server-mailgun module. My "verify email" works correctly and an email is sent to the user but I can not get my "reset password" to function. I expect there is a parameter I am missing in my index.js file but I cant see what it can be. Given that the "verify email" correctly sends the link that verifies the account it must be something specific to the "reset password" options. I have googled this extensively without finding what the problem is.

The verbose log after sending a request for "reset password" does not offer any information and looks like this (seems correct):

 [36mverbose[39m: REQUEST for [POST] /parse/requestPasswordReset: {
   "email": "me@<removed>"
   } method=POST, url=/parse/requestPasswordReset, host=<removed>.com, 
   x-real-ip=<removed>, x-forwarded-for=<removed>, <removed>, content- 
   length=35, accept=*/*, accept-encoding=br, gzip, deflate, accept- 
   language=en-us, content-type=application/json; charset=utf-8, user- 
   agent=<removed>/299 CFNetwork/975.0.3 Darwin/18.2.0 (x86_64), x- 
   parse-app-build-version=299, x-parse-app-display-version=1.0.0, x- 
   parse-application-id=<removed>, x-parse-client-key=<removed>, x- 
   parse-client-version=osx1.17.2, x-parse-installation-id=<removed>, 
   x-parse-os-version=10.14.1 (18B75), x-forwarded-port=443, x- 
   forwarded-proto=https, email=me@<removed>
   [36mverbose[39m: RESPONSE from [POST] /parse/requestPasswordReset: {
   "response": {}}

My index.js file for my server looks like this for the email settings:

 ....
  databaseURI: databaseUri,
  cacheAdapter: redisCache,
  cloud: path.join(__dirname + '/cloud/main.js'),
  appId: process.env.APP_ID,
  masterKey: process.env.MASTER_KEY,
  serverURL: process.env.SERVER_URL,
  allowClientClassCreation: false,
  maxUploadSize: '10mb',
  jsonLogs: true,
  logsFolder: path.join(__dirname+'/logs'),
  sessionLength: 31536000, // 1 year in seconds
  expireInactiveSessions: true,
  verbose: process.env.VERBOSE,  
  revokeSessionOnPasswordReset: true,
  expireInactiveSessions: true,
  enableAnonymousUsers: process.env.ENABLE_ANONYMOUS_USERS,
  publicServerURL: process.env.PUBLIC_SERVER_URL,
  appName: 'removed',
  schemaCacheTTL: 5000,
  verifyUserEmails: process.env.VERIFY_USER_EMAIL,
  emailVerifyTokenValidityDuration: 43200,
  emailAdapter: {
     module: 'parse-server-mailgun',
     options: {
         fromAddress: process.env.DEFAULT_FROM_ADDRESS
    domain: process.env.MAILGUN_DOMAIN
    host:'api.mailgun.net',
    apiKey: process.env.MAILGUN_API_KEY
    templates: {
        passwordResetEmail: {
            subject: 'Reset your password',
            pathPlainText: path.join(__dirname+'/public/assets/HTML/password_reset.text'),
            pathHtml: path.join(__dirname+'/public/assets/HTML/password_reset.html'),
            callback: (user) => {
                return {
                    firstName: user.get('firstName')
                }
            }
        },
        verificationEmail: {
            subject: 'Confirm your account',
            pathPlainText: path.join(__dirname+'/public/assets/HTML/email_verify.text'),
            pathHtml: path.join(__dirname+'/public/assets/HTML/email_verify.html'),
            callback: (user) => {
                return {
                    firstName: user.get('firstName')
                     }
                 }
             }
         }
     }
  },

Any insight as to what may be the problem or what I may be lacking would be appreciated. Thank You. Cheers, Trond

Originally posted by @trondkr in #4022 (comment)

@JacobJT
Copy link

JacobJT commented Dec 11, 2018

Is it reset_password instead of password_reset? I have the former, but don't recall if it's something custom set up. I know we customize the page, I don't know if we chose the path and it could be anything. We use the Sendgrid module and set up was just passing in an API key and e-mail we're sending from, but we add /public/reset_password.html to customPages property

@trondkr
Copy link
Author

trondkr commented Dec 11, 2018

@JacobJT Thank you! That was exactly the issue. I can't believe I spent so much time trying to get this to work when the solution was so obvious.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants