Altinn / Altinn/app-frontend-react
Linking to apps with language specified in the URL
- Dominant language
- TypeScript
- Stars
- 21
- Forks
- 33
- Avg merge
- 6d 23h
- Merged PRs (30d)
- 3
Description
### Description
Currently, you can link directly to an instance with a preselected language, like this:
`https://ttd.apps.tt02.altinn.no/ttd/frontend-test#/instance/51310141/4ed84f4e-3625-4f70-93f7-89ac91d6a164?lang=en`
You can also be redirected to the app without an instance by setting the lang parameter behind a `#` like this:
`https://ttd.apps.tt02.altinn.no/ttd/frontend-test#/?lang=en`
However, this only works if the user is already logged in, as the log-in process seems to send you to the message-box (with query-parameters and `#` stripped) instead of being redirected to the app.
It should be possible to link to an app with a language preselected by specifying a query-parameter, like:
`https://ttd.apps.tt02.altinn.no/ttd/frontend-test?lang=en`
This requires the login-flow to actually redirect the browser to the app after logging in, and preserving query-parameters (and/or hash).
Whether we want to require setting the language parameter behind a `#` or not is an open question. If not, we either need to move away from using hash-based routing so we just read this as normal, or we need to look for "real" query parameters as well.
### Additional Information
- [Question on slack](https://altinn.slack.com/archives/C02EJ9HKQA3/p1708432115946879)
- #825
Contributor guide
Research direction
Start by reproducing the two URL forms described in the issue, both while logged in and through the login flow, then trace the frontend routing and login redirect entry points. Done means a user opening an app URL with a language parameter is returned to that app after login with the relevant query parameters and/or hash preserved; resolve whether the parameter belongs before or after the hash.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- authentication, frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100