-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: 3760/redirect to application (#3839)
* feat: redirect user after forget password email * refactor: parse query params as strings * feat: redirect user to application after create account * feat: confirmation Modal redirect * feat: redirect after resendConfirmation button * fix: add SHOW_MANDATED_ACCOUNTS var * refactor: check feature toggle first * fix: maintain default behavior when SHOW_MANDATED_ACCOUNTS is FALSE * refactor: remove bend feature toggle * refactor: add helper * refactor: helper function to generate email url * refactor: getListingRedirectUrl helper * style: cleanup * fix: cleanup
- Loading branch information
1 parent
1c99bcf
commit 5f4c303
Showing
11 changed files
with
96 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/** | ||
* Creates a email URL object from passed url applies redirectUrl and listingId query params if they exist | ||
* If they do not exist, the return value will be the email url with just the necessary token | ||
*/ | ||
|
||
export const getPublicEmailURL = (url: string, token: string, actionPath?: string): string => { | ||
const urlObj = new URL(url) | ||
|
||
const redirectUrl = urlObj.searchParams.get("redirectUrl") | ||
const listingId = urlObj.searchParams.get("listingId") | ||
|
||
let emailUrl = `${urlObj.origin}${urlObj.pathname}/${actionPath ? actionPath : ""}?token=${token}` | ||
|
||
if (!!redirectUrl && !!listingId) { | ||
emailUrl = emailUrl.concat(`&redirectUrl=${redirectUrl}&listingId=${listingId}`) | ||
} | ||
return emailUrl | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export const getListingRedirectUrl = ( | ||
listingIdRedirect: string | undefined, | ||
path: string = window.location.origin | ||
) => { | ||
return process.env.showMandatedAccounts && listingIdRedirect | ||
? `${path}?redirectUrl=/applications/start/choose-language&listingId=${listingIdRedirect}` | ||
: path | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters