Skip to content

Commit

Permalink
Merge 01dc3f5 into 319dfb4
Browse files Browse the repository at this point in the history
  • Loading branch information
tfehring committed Dec 22, 2021
2 parents 319dfb4 + 01dc3f5 commit deafb85
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion adsws/accounts/config.py
Expand Up @@ -41,4 +41,4 @@
GOOGLE_RECAPTCHA_ENDPOINT = 'https://www.google.com/recaptcha/api/siteverify'
MAIL_DEFAULT_SENDER = 'no-reply@adslabs.org'

PASSWORD_RESET_URL = 'https://ui.adsabs.harvard.edu/#user/account/verify/reset-password'
VERIFY_URL = 'https://ui.adsabs.harvard.edu/#user/account/verify'
9 changes: 4 additions & 5 deletions adsws/accounts/views.py
Expand Up @@ -22,6 +22,7 @@
from sqlalchemy import func
from sqlalchemy.orm import load_only
from adsmutils import get_date
from urlparse import urljoin

class StatusView(Resource):
"""
Expand Down Expand Up @@ -115,7 +116,7 @@ def post(self, token):
send_email(
email_addr=token,
email_template=PasswordResetEmail,
base_url=current_app.config['PASSWORD_RESET_URL'],
base_url=urljoin(current_app.config['VERIFY_URL'], 'reset-password'),
payload=token
)
return {"message": "success"}, 200
Expand Down Expand Up @@ -459,7 +460,6 @@ def post(self):
data = get_post_data(request)
email = data['email']
password = data['password']
verify_url = data['verify_url']
except (AttributeError, KeyError):
return {'error': 'malformed request'}, 400

Expand All @@ -473,7 +473,7 @@ def post(self):
}, 403
send_email(
email_addr=email,
base_url=verify_url,
base_url=urljoin(current_app.config['VERIFY_URL'], 'change-email'),
email_template=VerificationEmail,
payload=[email, u.id]
)
Expand Down Expand Up @@ -609,7 +609,6 @@ def post(self):
email = data['email']
password = data['password1']
repeated = data['password2']
verify_url = data['verify_url']
except (AttributeError, KeyError):
return {'error': 'malformed request'}, 400

Expand All @@ -628,7 +627,7 @@ def post(self):
' registered for {0}'.format(email)}, 409
send_email(
email_addr=email,
base_url=verify_url,
base_url=urljoin(current_app.config['VERIFY_URL'], 'register'),
email_template=WelcomeVerificationEmail,
payload=email
)
Expand Down

0 comments on commit deafb85

Please sign in to comment.