Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 21 additions & 4 deletions app/src/ui/sign-in/sign-in.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,8 @@ const DefaultTitle = 'Sign in'

const browserSignInInfoContent = (
<p>
Your browser will redirect you back to GitHub Desktop once you've signed in.
If your browser asks for your permission to launch GitHub Desktop, please
allow it.
Your browser will open so you can approve this sign-in. Come back here for
the code you'll need to enter.
</p>
)

Expand Down Expand Up @@ -188,10 +187,28 @@ export class SignIn extends React.Component<ISignInProps, ISignInState> {
</p>
) : undefined

// Sign in is the OAuth device flow: the user has to type a short code into
// their browser, so this is the one place it can be read from. Until the
// code arrives there is nothing to show but what is about to happen.
const { deviceFlow } = state

return (
<DialogContent>
{credentialHelperInfo}
{browserSignInInfoContent}
{deviceFlow ? (
<>
<p className="device-flow-instructions">
Enter this code at <Ref>{deviceFlow.verificationURI}</Ref> to
finish signing in. Keep this window open — it'll continue
automatically once you approve.
</p>
<div className="device-flow-user-code" role="status">
{deviceFlow.userCode}
</div>
</>
) : (
browserSignInInfoContent
)}
</DialogContent>
)
}
Expand Down
40 changes: 21 additions & 19 deletions app/styles/ui/_device-flow.scss
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
// Sign in uses the OAuth device flow: the user is shown a short code to type
// into their browser. The code has to be effortless to read and transcribe, so
// it gets a monospace face, generous tracking and a lot of size.
.sign-in-form {
.device-flow-instructions {
margin-bottom: var(--spacing);
color: var(--text-secondary-color);
}
//
// Deliberately not scoped to a container. The code is shown from two places -
// the welcome flow's form and the sign-in dialog - and scoping this to the
// first is what left the second with no styles for it at all.
.device-flow-instructions {
margin-bottom: var(--spacing);
color: var(--text-secondary-color);
}

.device-flow-user-code {
font-family: var(--font-family-monospace);
font-size: var(--font-size-xl);
font-weight: var(--font-weight-semibold);
.device-flow-user-code {
font-family: var(--font-family-monospace);
font-size: var(--font-size-xl);
font-weight: var(--font-weight-semibold);

// Digits and letters are easy to confuse when they're packed together.
letter-spacing: 0.2em;
text-align: center;
user-select: text;
// Digits and letters are easy to confuse when they're packed together.
letter-spacing: 0.2em;
text-align: center;
user-select: text;

padding: var(--spacing) var(--spacing-double);
margin-bottom: var(--spacing-double);
padding: var(--spacing) var(--spacing-double);
margin-bottom: var(--spacing-double);

border: var(--base-border);
border-radius: var(--border-radius);
background: var(--box-alt-background-color, var(--box-background-color));
}
border: var(--base-border);
border-radius: var(--border-radius);
background: var(--box-alt-background-color, var(--box-background-color));
}
Loading