mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-12 08:12:27 -05:00
Allow admin to specify domain for email auth links
Similar to https://github.com/alphagov/notifications-api/pull/1515 This lets the admin app pass in a domain to use for email auth links, so that when it’s running on a different URL users who try to sign in will get an email auth link for the domain they sign in on, not the default admin domain for the environment in which the API is running.
This commit is contained in:
@@ -20,10 +20,10 @@ def pagination_links(pagination, endpoint, **kwargs):
|
||||
return links
|
||||
|
||||
|
||||
def url_with_token(data, url, config):
|
||||
def url_with_token(data, url, config, base_url=None):
|
||||
from notifications_utils.url_safe_token import generate_token
|
||||
token = generate_token(data, config['SECRET_KEY'], config['DANGEROUS_SALT'])
|
||||
base_url = config['ADMIN_BASE_URL'] + url
|
||||
base_url = (base_url or config['ADMIN_BASE_URL']) + url
|
||||
return base_url + token
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user