Closed keybits closed 1 year ago
The secret share link in emails to Friends and the link that can be copied from the UI are both broken when deployed to production.
This broke after we refactored and removed ORIGIN as a hard-coded enironment variable at build time.
ORIGIN
As per the SvelteKit docs we're setting PROTOCOL_HEADER=x-forwarded-proto HOST_HEADER=x-forwarded-host when starting the app.
PROTOCOL_HEADER=x-forwarded-proto HOST_HEADER=x-forwarded-host
This should make origin available as a property of url.
origin
url
Can we fix to make the links correct?
For the email we get a link in the form:
http://letters/your-post?secret=V55F90GJZ1XwoJzvreoUm
For the copyable link it gives:
undefined/letters/your-post?secret=V55F90GJZ1XwoJzvreoUm
We get undefined because we're not correctly getting origin in line 13 of CopyableRecipient.svelte:
$: origin = $page.data.origin;
Fixed via: https://github.com/PostOwl/postowl/commit/729e32bc3f476dd3d0038eb1f97aca7c3e17d4bc
The secret share link in emails to Friends and the link that can be copied from the UI are both broken when deployed to production.
This broke after we refactored and removed
ORIGIN
as a hard-coded enironment variable at build time.As per the SvelteKit docs we're setting
PROTOCOL_HEADER=x-forwarded-proto HOST_HEADER=x-forwarded-host
when starting the app.This should make
origin
available as a property ofurl
.Can we fix to make the links correct?
Examples of broken links
For the email we get a link in the form:
For the copyable link it gives:
We get undefined because we're not correctly getting
origin
in line 13 of CopyableRecipient.svelte: