diff --git a/README.md b/README.md index ea99029d..c6ff6a90 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,7 @@ relates to weekly certification - CERTIFICATE_DIR: The path to the client certificate (certificate must be in PFX/P12 format) - PFX_FILE: The name of the client certificate file - (Optional) PFX_PASSPHRASE: The import passphrase for the client certificate if there is one +- (Optional) URL_UIO_LANDING, URL_UIOMOBILE_LANDING: The environment-specific links to the UIO and UIO Mobile landing pages For local development: diff --git a/utils/getUrl.ts b/utils/getUrl.ts index 69721f10..e6be0497 100644 --- a/utils/getUrl.ts +++ b/utils/getUrl.ts @@ -11,6 +11,10 @@ export type UrlType = keyof typeof urls * Get url from urls.json */ export default function getUrl(linkKey: string): string | undefined { + // Optional environment-specific links back to the UIO landing page, used by EDD testing + if (linkKey === 'uio-home-url-desktop' && process.env.URL_UIO_LANDING) return process.env.URL_UIO_LANDING + if (linkKey === 'uio-home-url-mobile' && process.env.URL_UIOMOBILE_LANDING) return process.env.URL_UIOMOBILE_LANDING + // Explicitly cast to one of the allowed keys in urls.json. // If the key does not exist in urls.json, this function will return undefined. const key = linkKey as UrlType