Update middleware to account for redirect after MSCA login #626
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
ADO-192855
Fixed AB#192855
Changelog
fix: Update middleware to handle MSCA redirect
Description of proposed changes:
This PR updates our middleware to handle the redirect from MSCA after logging in. Since the recent changes to the ARB in dev, Stream 3 has been redirecting to
/&Lang=eng
or/&Lang=fra
depending on the language selected before redirecting. This PR adds a couple rules at the top of the stack in our middleware that checks for this and redirects to the respective dashboard page.What to test for/How to test
npm run dev
/&Lang=eng
(casing is important here as the parameter passed to us is uppercase Lang). You should be redirected to the English dashboard/&Lang=fra
. You should be redirected to the French dashboardAdditional Notes
In the future we should look into leveraging the NEXT_LOCALE cookie to handle locale redirection. More info can be found here: https://nextjs.org/docs/pages/building-your-application/routing/internationalization#leveraging-the-next_locale-cookie