-
Notifications
You must be signed in to change notification settings - Fork 453
Switch to AuthView on Publish API Failure #300
Conversation
Yup, I'm 👍 in favor of explaining why they're taken to the authentication screen. Any strong feelings about checking first if they're signed in before displaying the publish form? If they're not logged in, then we could show them the sign-in form with a little error up on top: I can push up an example branch if that helps! |
|
Cool. Thanks for the draft. |
dc579f2 to
90d1f0c
Compare
… we get from the api
…re-switch-auth-view
…ting specific views
…e-switch-auth-view
…e-switch-auth-view
…e-switch-auth-view
Use default padding settings
…e-switch-auth-view
| var usernameMismatchException = exception as TokenUsernameMismatchException; | ||
| if (usernameMismatchException != null) | ||
| { | ||
| message = "Your credentials need to be refreshed"; |
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.
Been thinking about this some more and talking to some people about what messages should say, and we should probably explain a bit more why we're doing this.
How about:
We've detected that your stored credentials are out of sync with your current user. This can happen if you have signed in to git outside of Unity. Sign in again to refresh your credentials.
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.
That sounds much better.
|
|
||
| if (usernameMismatchException == null && keychainEmptyException == null) | ||
| { | ||
| message = "There was an error validating your account"; |
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.
All of these messages should be in const fields somewhere so we can localize them later
|
|
||
| if (usernameMismatchException == null && keychainEmptyException == null) | ||
| { | ||
| message = "There was an error validating your account"; |
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 feel like this message is a bit unhelpful, especially given that it's the first thing they see right after clicking the button. When does this happen and is this our fault or the users'? If it's our fault, then we should followup with "Please sign in again" to tell them how to proceed here.
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.
It actually hasn't happened to me yet, so it would probably be best to leave the original exception message there instead.
|
@donokuda I feel like the current auth view does not match the publish view. I think it was different before because you would completely leave the auth view and then separately enter the publish view. After these changes that will no longer be the case, one will flow into another. Maybe it's just the lack of an invertocat that makes me feel like it's missing. |
|
Here's where this PR is at right now. It's ready for some feedback: Sign in view with warning: 2FA view (is there a way to suppress that error if this is the first time viewing this screen?) I also noticed when you hit "back" from the 2FA, it will still persist the error message even though it's not relevant to the screen before. Is there a way to prevent that from happening? |
…t-objects Preventing the exposure of Octokit objects to the codebase
|
I like this UI a lot, those message box styles rock!
We probably need to call Repaint/Redraw on the window to refesh the UI here I wonder how we handle the Esc key. We should probably close the window and cancel the whole thing. |
|
|
||
| if (shouldProceed) | ||
| { | ||
| //Proceed as current user |
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.
Still need to work out what happens here..
| } | ||
| else | ||
| { | ||
| //Logout current user and try again |
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.
And here..
|
Actually... the more I look at it this code will never run, Unity/src/UnityExtension/Assets/Editor/GitHub.Unity/UI/PublishView.cs Lines 126 to 147 in b108e06
|
shana
left a comment
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.
omgomgomgomgomg this looks so awesome! 🎉 🚀
|
Fixes #414 |







Currently our only exposure to the API is
PublishView. In the event of an authentication failure we need to switch thePublishViewto theAuthenticationView-If there is no authentication present

Depends on: