Skip to content

Show feedback modal after resetting WAYF remembered choice - #358

Open
kayjoosten wants to merge 1 commit into
wayf-reset-choice-linkfrom
350-wayf-reset-feedback-modal
Open

kayjoosten wants to merge 1 commit into
wayf-reset-choice-linkfrom
350-wayf-reset-feedback-modal

Conversation

@kayjoosten

Copy link
Copy Markdown
Contributor

If applied, this commit will

Show the user a modal confirming the outcome of resetting their remembered WAYF login-method choice.

Why is this change needed?

Prior to this change, resetting the "remember my choice" cookie via the profile page redirected back silently. The user had no feedback on whether a cookie was actually removed or whether there was none to begin with.

How does it address the issue?

This change reads the wayfReset query parameter set by EngineBlock's reset endpoint (removed or none) through a new WayfResetResultResolver service, and passes it to the overview template. The template renders an auto-opening modal, reusing the existing modal helper, with copy that matches the removed/none outcome. The modal helper is extended with autoOpen and cleanParam options so the modal shows itself on load and the query parameter is stripped from the URL afterwards, and its header id is now derived from the modal's own linkId rather than loop.index so multiple modals on one page never collide.

Builds on top of #353.

Provide links to any relevant tickets, articles or other resources

Fixes #350

# If applied, this commit will
Show the user a modal confirming the outcome of resetting their
remembered WAYF login-method choice.

# Why is this change needed?
Prior to this change, resetting the "remember my choice" cookie via
the profile page redirected back silently. The user had no feedback
on whether a cookie was actually removed or whether there was none
to begin with.

# How does it address the issue?
This change reads the wayfReset query parameter set by EngineBlock's
reset endpoint (removed or none) through a new WayfResetResultResolver
service, and passes it to the overview template. The template renders
an auto-opening modal, reusing the existing modal helper, with copy
that matches the removed/none outcome. The modal helper is extended
with autoOpen and cleanParam options so the modal shows itself on
load and the query parameter is stripped from the URL afterwards,
and its header id is now derived from the modal's own linkId rather
than loop.index so multiple modals on one page never collide.

# Provide links to any relevant tickets, articles or other resources
#350
@kayjoosten
kayjoosten force-pushed the 350-wayf-reset-feedback-modal branch from 1917fa1 to 4a5a1f7 Compare October 2, 2026 11:58

@johanib johanib left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code seems fine, just the weird history.replace. Can we prevent this? Seems to bug out in ff?

Comment thread assets/js/modalWindow.js
if (cleanParam) {
const url = new URL(window.location.href);
url.searchParams.delete(cleanParam);
window.history.replaceState(null, '', url.pathname + url.search + url.hash);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redirect loop in FF?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants