Closed juanf9224 closed 4 months ago
Hi!
Can you share a bit more info on what exactly goes wrong?
Do you use the usePasswordless hook or also the prefab components?
Is the sign-in link still in the URL at that point? If you know you'll not need it (because it is expired) you may want to clear it.
For conditionally rendering the right UI use the signInStatus
field btw not the signingInStatus
field.
Just looking at the field signInStatus should be enough to figure out whether or not to show the right sign in page (was made for that purpose). Since being signed in (=have valid JWTs), and signing in, can exist in parallel (eg in case of step up auth), these statuses were separated into two different fields (they are related but not the same).
Hey @ottokruse , sorry for not getting back on this,
I'm using the usePasswordless hook
what I want is to show a different component for expired links
vs link sent
for example, now, when a link fails for whatever reason I also want to show a custom component with that feedback, and have a button to go back to sign in page/component but since the status is not updated without a reload, what it does is sends me back to failed link component since I'm rendering each of those components conditionally inside the sign in component based on the signingInStatus
.
I'm using the signingInStatus
instead of signInStatus
because it offers me more specific statuses which is what I need for deciding which component to render.
the components would be something like this: component A has => component B, C ,D, E A ---- By default render B ---- if Expired render C ---- if Sent render D ---- if Invalid render E ----------- if go back to sign in clicked, render A with cleared status so sign in form is shown
@ottokruse I ended up using a state to handle this, was hoping to be able to use the same hook but this way is not complex so I guess not really important to have such functionality.
Hi,
I created multiple state components for some of the
signingInStatus
states, I have an issue when trying to go back from let's say,EXPIRED
state to sign in view, since the sign in page has the conditional render for the expired state if I go back to it it just renders the expired link state component again because thesigningInStatus
is still on theEXPIRED
state, I have to do a reload to reset state, is there any other way to achieve this?