Skip to content

Handle invalid unsubscriptions #7690

Open
wants to merge 1 commit into from

4 participants

@BKinahan

Add logic to handle requests to server for e-mail unsubscribe URLs when a matching user is not found.

Redirects to /map and informs the user to update e-mail settings from their profile.

Tested locally for each link, for both valid and invalid e-mail addresses, and passes npm test.

Closes #7686.

@virus79
@BerkeleyTrue BerkeleyTrue commented on an outdated diff
server/boot/randomAPIs.js
});
- return res.redirect('/unsubscribed');
- });
+ return res.redirect('/map');
+ } else {
+ return user.updateAttribute('sendMonthlyEmail', false, (err) => {

This else is unnecessary. You can remove it and outdent the content. Same goes for the code below.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@camperbot

@BKinahan updated the pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.