Skip to content

Commit

Permalink
add url safe b64 encoding/decoding
Browse files Browse the repository at this point in the history
  • Loading branch information
Jimmyj30 committed Apr 7, 2024
1 parent 543332e commit 21cdff2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/email.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@

def generate_edit_link(user_config: dict) -> str:
config_json_string = json.dumps(user_config)
config_b64_string = base64.b64encode(config_json_string.encode()).decode()
encoded_json = config_json_string.encode()
config_b64_string = base64.urlsafe_b64encode(encoded_json).decode()
base_url = "https://cloud.watonomous.ca/docs/utilities/onboarding-form"
edit_link = f"{base_url}?initialformdatab64={config_b64_string}"
logger.debug(f"Edit link (truncated): {edit_link[0:100]}...")
Expand Down

0 comments on commit 21cdff2

Please sign in to comment.