Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
HTTPSify emailed links containing secret tokens
Thanks to @edent for the report!
  • Loading branch information
JordanMilne committed Dec 1, 2014
1 parent df75e16 commit 9f1f5a2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion r2/r2/lib/emailer.py
Expand Up @@ -60,7 +60,8 @@ def verify_email(user, dest=None):
Award.take_away("verified_email", user)

token = EmailVerificationToken._new(user)
emaillink = 'http://' + g.domain + '/verification/' + token._id
base = g.https_endpoint or g.origin
emaillink = base + '/verification/' + token._id
if dest:
emaillink += '?dest=%s' % dest
g.log.debug("Generated email verification link: " + emaillink)
Expand Down
3 changes: 2 additions & 1 deletion r2/r2/models/token.py
Expand Up @@ -751,4 +751,5 @@ def post_url(self):

def confirm_url(self):
# Full URL; for emailing, PM'ing, etc.
return "http://%s/awards/confirm/%s" % (g.domain, self._id)
base = g.https_endpoint or g.origin
return "%s/awards/confirm/%s" % (base, self._id)

0 comments on commit 9f1f5a2

Please sign in to comment.