-
Notifications
You must be signed in to change notification settings - Fork 829
[Bug 918002] Give feedback that Persona is working. #1629
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
Conversation
|
This is neat, but I don't think it solves all cases and, specifically, the case Kadir ran into. The problem is when you are confirming your email manually, it opens a link that redirects to the page you were on SUMO. Then this page loads and the watch api kicks in and at some point realizes you are logged in and reloads the page. Since this is a brand new tab, nothing has been clicked on it. I'm not sure what we can do to detect this was from the email and we are likely waiting for browser id. I am r+ on this fix. But there is more to do. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wait, according to the docs it is oncancel https://developer.mozilla.org/en-US/docs/Web/API/navigator.id.request
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK! Why would they do that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I pushed 6723c49, which changes the case of that param.
This is actually even better now, because when the user closes the Persona window, it calls oncancel, which is kind of what I expected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yay!
|
Right this, is just a fix for when users click the button directly, not when the watch api kicks us. The two-sumo-tabs problem is something I haven't thought about, and it is a bit lame. |
|
i wonder if we can do some trick with localstorage to keep track of the state of logging in across tabs. or mostly just for new tabs that get opened. |
|
I don't follow. What would this gain us? Since we are switching to the watch api (right?) Persona will notify us when the user is logged in. |
|
So the problem is that the watch api cant take it's good time to kick in once a fresh new tab is opened on sumo. Which is what happens when you click the confirm email link in the persona activation email. |
|
Oh, that make sense. I just did that sign in process and watched both windows at once. The first window doesn't know you signed in any sooner than the other, but we could do something like |
This helps the case where Persona takes a little while to do the assertion dance. It seems a little confusing for Persona to go away, and no more instructions be given to the user, but the button still says "Sign in with email". This fixes that by changing the text to something that implies something is happening. I chose this text because it is the same text that is shown on the Persona popup.
I'm not sure in what cases
onCancelwill be called, but it is mentioned in the docs, and I assume it will happen anytime a failure happens. The docs sayonCancelis "A function that will be invoked if the user refuses to share an identity with the site."r?