Skip to content

Reset Password - MailGun & Parse-Server #1410

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
bgengs opened this issue Apr 7, 2016 · 6 comments
Closed

Reset Password - MailGun & Parse-Server #1410

bgengs opened this issue Apr 7, 2016 · 6 comments

Comments

@bgengs
Copy link

bgengs commented Apr 7, 2016

Hello World,

Currently working on a side project with the parse server. I cloned the "example parse server application", migrated my parse.com hosted data and everything is running smooth on my localhost and the Digital Ocean backend. I've successfully installed the mail-gun adapter and will receive an email when the parse php sdk - password reset option is "initiated" by the user. The problem is, the link within the email sent by mail-gun, doesn't work. "500 External Server Error" or "{error: unauthorized}". I added the cloud code but for some reason it will not init. Any help would be greatly appreciated - if your looking for side work shoot me a message.

var server = ParseServer({ verifyUserEmails: true, publicServerURL: 'https://example.com/parse', appName: 'Parse App', emailAdapter: { module: 'parse-server-simple-mailgun-adapter', options: { fromAddress: '[email protected]', domain: 'example.com', apiKey: 'key-mykey', }}});

@bgengs
Copy link
Author

bgengs commented Apr 7, 2016

image

image

@drew-gross
Copy link
Contributor

You shouldn't need any cloud code for reset emails. This doesn't look like a Parse Server error though. Do you have any URL rewriting in nginx? Have you checked that your publicServerURL is correct? I can't see your full URL in that screenshot so I can't tell.

@bgengs
Copy link
Author

bgengs commented Apr 7, 2016

@drew-gross Thank you for the reply. I don't need cloud code for reseting emails? I thought to be able to send "reset password emails" you needed to use mailgun? Especially with parse-server hosted on your own server... I do not have any URL rewriting enabled in nginx. The PublicServerURL is correct - does Parse-Server automatically implement URL rewriting? I've been digging in the parse server files / node modules, their isn't a "View/Route" for sending reset emails...

https://github.com/ParsePlatform/parse-server-example

It's getting to the point where I'm going to remove the parse server example and redo the entire installation from scratch / git.

@drew-gross
Copy link
Contributor

The requestPasswordReset function can be called from the client. You need configuration for the email adapter, but no Parse.Cloud.define() calls. Try calling the requestPasswordReset function from the client and see if that helps.

If you are checking out the code for password resets, you can find it here:

https://github.com/ParsePlatform/parse-server/blob/7afc08abe4914482e790054f78d5ae112e554222/src/Routers/PublicAPIRouter.js

@bgengs
Copy link
Author

bgengs commented Apr 7, 2016

@drew-gross Thank you so much man, means the world. After reviewing the nginx logs theirs seems to be some type of problem with your original idea of nginx rewriting. Even tho the Parse server is functional and accessible by the app, it seems that the URL rewriting is the problem. Looking / Researching to fix this issue now, will keep you posted.

image

image

@bgengs
Copy link
Author

bgengs commented Apr 7, 2016

@drew-gross Simple Mistake - needed to add this to nginx - thanks again man!

location /parse {
proxy_pass http://localhost:1337;
}

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