Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue logging in after making wrong choice when using a custom IInstantiationValidator #3000

Open
alehel opened this issue Feb 7, 2025 · 1 comment
Labels
kind/bug Something isn't working status/triage

Comments

@alehel
Copy link

alehel commented Feb 7, 2025

Description of the bug

When using a custom IInstantiationValidator, if validation fails, the user can get stuck trying to change the party they are representing.

We have a custom IInstantiationValidator in one of our forms. This validator allows "Privatpersoner", "juridisk enhet uten underenheter" and "underenheter".

Steps To Reproduce

  1. Go to our form Registrering av importør/distributør/produsent av kosmetikk og tatoveringsprodukter in TT02.
  2. Log in as a user able to represent themselves, a juridisk enhet and underenhet.
  3. In the party selection screen, select the juridisk enhet.
  4. You should now see a 403 screen specifying that you can't use the service.
  5. Click the back button in your browser, and select the underenhet.
  6. Once again you get the 403 screen, despite the fact that you should now be allowed to use the service.
  7. In the browser, change the url to be "https://mat.apps.tt02.altinn.no/mat/mattilsynet-kosmetikk". This should take you the party-selection page again.
  8. Now select the underenhet again, and you should be taken to the form.

It seems that when using the browsers back button, some form of state remains, preventing the user from changing party. This creates a confusing login process, where the user gets the impression that they can't use the form.

Additional Information

Ideally, we would have liked to reproduce the error screen used when a user fails the "oppstartskontroll" validation, by redirecting them back to the party-selection screen with a custom error message like so,

Image
@alehel alehel added the kind/bug Something isn't working label Feb 7, 2025
@ivarne ivarne transferred this issue from Altinn/app-lib-dotnet Feb 12, 2025
@alehel
Copy link
Author

alehel commented Feb 12, 2025

Regarding my comment under "Additional Information". ivarne pointed out on Slack that the InstantiationValidationResult object we return contains a validParties fileld. We assume we could achieve the desired behaviour by using this, but we've been unable to find a way of determining what parties the user has access to, and how to aquire them. Is there an endpoint we can call in the app for such information?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working status/triage
Projects
Status: No status
Development

No branches or pull requests

1 participant