Skip to content
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

unsubscribe link from email not working #662

Open
pdcoutinho opened this issue Jun 6, 2015 · 5 comments
Open

unsubscribe link from email not working #662

pdcoutinho opened this issue Jun 6, 2015 · 5 comments
Assignees
Labels

Comments

@pdcoutinho
Copy link

Users are sent an email if their subscribed topics are replied.

In said email, there is a link to unsubscribe. That link issues a GET request, but routes show a POST, and the website breaks.

http://example.com/forums/some-forum/topics/some-topic/unsubscribe

forem (1.0.0.beta1)
Rails 4.2.0

no route matches get unsubscribe bla bla bla bla ^^

@radar
Copy link
Collaborator

radar commented Jun 8, 2015

Hi @pdcoutinho. Thanks for submitting this issue. Could you please submit a patch to fix it? That would be great. Changing the route to be a GET route should fix it.

@Nateowami
Copy link

@radar This was to protect from a CSRF attack. See #522. Perhaps the authenticity_token can be added as a parameter in the URL.

@radar
Copy link
Collaborator

radar commented Jul 12, 2015

Rather than an authenticity token, could we instead have a unique hash on the topic + subscription that is generated + then is passed through in this request? The route will change to a GET request, and the token will make it so that nobody would be able to CSRF-attack a way for people to unsubscribe.

I'm thinking something such as SecureRandom.hex(24) should be fine for this.

@radar
Copy link
Collaborator

radar commented Jul 12, 2015

Patches welcome to fix this :) I do not have time myself.

@radar
Copy link
Collaborator

radar commented Jul 13, 2015

Turns out I do have time to fix this.

Please review #669 and let me know if it's suitable for you.

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

No branches or pull requests

4 participants