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

Use referrer to determine URL sent in emails #149

Merged
merged 1 commit into from
Feb 12, 2018
Merged

Conversation

brycekahle
Copy link
Contributor

- Summary
Fixes #112

- Test plan
Added tests for email URL generation function w/ referrer included.

- Description for the changelog
Use referrer to determine URL sent in emails.

if reqref := r.Referer(); reqref != "" {
base, berr := url.Parse(config.SiteURL)
refurl, rerr := url.Parse(reqref)
// As long as the referrer came from the site, we will redirect back there
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about localhost?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you try to log in from a site running on localhost, will the confirm emails pick that up in the redirect they send you?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only if the site URL is also localhost

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

Successfully merging this pull request may close these issues.

2 participants