LG-5025: Create separate throttle error screen for proof_ssn throttle type#5346
LG-5025: Create separate throttle error screen for proof_ssn throttle type#5346
Conversation
There was a problem hiding this comment.
Could make a query parameter for the failure route, I suppose? 🤔
There was a problem hiding this comment.
If we wanted to have one route and parameterize, I'd consider a path param:
get '/session/errors/:error' => 'session_errors#show'
and then have #show do a 404 or something with an unknown params[:error]
There was a problem hiding this comment.
If we wanted to have one route and parameterize, I'd consider a path param:
get '/session/errors/:error' => 'session_errors#show'and then have
#showdo a 404 or something with an unknownparams[:error]
I explored this a bit, and I think there's room for refactoring here, though ultimately I struggled to find a reasonable improvement over just keeping the separate method here.
A few factors:
- There's several different warnings and errors for this controller, so it's unclear if we'd want a route segment for just the failures, or for every one of the possible screens. Maybe we could refactor this for one controller method which builds a presenter object for the specific throttle / messaging to be shown?
- We use a lot of URL helpers for these routes, which would need to be updated, e.g.
idv_session_errors_failure_urltoidv_session_errors_url(:failure). Not difficult, but widespread. - Maybe at some point we'd want to have specific texts for the SSN proofing failure, at which point we'd not need to reuse the
failuretemplate like we are here, and can follow the established pattern. - Considering LG-4637: Show accurate time remaining for IAL2 throttle screens #5301, we'll also need to set an instance variable for the appropriate throttle type, else we could just point directly to the controller method i.e.
get '/session/errors/ssn_failure' => 'session_errors#failure'
There was a problem hiding this comment.
bummer, thanks for checking!
There was a problem hiding this comment.
If we wanted to have one route and parameterize, I'd consider a path param:
get '/session/errors/:error' => 'session_errors#show'
and then have #show do a 404 or something with an unknown params[:error]
… type **Why**: So that each throttle error screen corresponds to exactly one throttle type, to accommodate accurate time labels proposed in #5301 (LG-4637).
4379919 to
52effd3
Compare
Why: So that each throttle error screen corresponds to exactly one throttle type, to accommodate accurate time labels proposed in #5301 (LG-4637).