auth - modernise local redirect page (#251895)

This commit is contained in:
Benjamin Pasero
2025-06-19 16:56:55 +02:00
committed by GitHub
parent d71ab97115
commit a6c11ed472
2 changed files with 74 additions and 76 deletions

View File

@@ -33,90 +33,84 @@ body {
display: flex;
flex-direction: column;
color: var(--vscode-foreground);
font-family: "Segoe UI","Helvetica Neue","Helvetica",Arial,sans-serif;
font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", system-ui, "Ubuntu", "Droid Sans", sans-serif;
background-color: var(--vscode-editor-background);
}
a {
color: var(--vscode-textLink-foreground);
}
.branding {
background-image: url('code-icon.svg');
background-size: 24px;
background-repeat: no-repeat;
background-position: left center;
padding-left: 36px;
font-size: 20px;
letter-spacing: -0.04rem;
font-weight: 400;
color: var(--vscode-foreground);
text-decoration: none;
}
.message-container {
flex-grow: 1;
a:hover, a:focus {
text-decoration: underline;
}
.container {
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
margin: 0 30px;
text-align: center;
}
.message {
.icon-container {
margin-bottom: 24px;
}
@keyframes rise-and-glow {
0% {
opacity: 0;
transform: translateY(10px);
filter: drop-shadow(0 0 0 rgba(0, 122, 204, 0));
}
60% {
opacity: 1;
transform: translateY(0);
}
100% {
opacity: 1;
transform: translateY(0);
filter: drop-shadow(0 8px 24px rgba(0, 122, 204, 0.3));
}
}
.vscode-icon {
width: 128px;
height: 128px;
animation: rise-and-glow 1.2s ease-in-out forwards;
}
.title {
font-size: 28px;
font-weight: 300;
font-size: 1.4rem;
margin: 0 0 12px 0;
color: var(--vscode-foreground);
}
body.error .message {
display: none;
}
body.error .error-message {
display: block;
}
.error-message {
display: none;
.subtitle {
font-size: 18px;
font-weight: 300;
font-size: 1.3rem;
color: var(--vscode-foreground);
opacity: 0.7;
margin: 0 0 36px 0;
}
.error-text {
.detail {
font-size: 14px;
color: var(--vscode-foreground);
opacity: 0.7;
margin: 0;
}
body.error .detail {
color: var(--vscode-error-foreground);
font-size: 1rem;
}
@font-face {
font-family: 'Segoe UI';
src: url("https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/light/latest.eot"),url("https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/light/latest.eot?#iefix") format("embedded-opentype");
src: local("Segoe UI Light"),url("https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/light/latest.woff2") format("woff2"),url("https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/light/latest.woff") format("woff"),url("https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/light/latest.ttf") format("truetype"),url("https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/light/latest.svg#web") format("svg");
font-weight: 200
body.error .success-message {
display: none;
}
@font-face {
font-family: 'Segoe UI';
src: url("https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/semilight/latest.eot"),url("https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/semilight/latest.eot?#iefix") format("embedded-opentype");
src: local("Segoe UI Semilight"),url("https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/semilight/latest.woff2") format("woff2"),url("https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/semilight/latest.woff") format("woff"),url("https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/semilight/latest.ttf") format("truetype"),url("https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/semilight/latest.svg#web") format("svg");
font-weight: 300
}
@font-face {
font-family: 'Segoe UI';
src: url("https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/normal/latest.eot"),url("https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/normal/latest.eot?#iefix") format("embedded-opentype");
src: local("Segoe UI"),url("https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/normal/latest.woff2") format("woff"),url("https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/normal/latest.woff") format("woff"),url("https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/normal/latest.ttf") format("truetype"),url("https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/normal/latest.svg#web") format("svg");
font-weight: 400
}
@font-face {
font-family: 'Segoe UI';
src: url("https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/semibold/latest.eot"),url("https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/semibold/latest.eot?#iefix") format("embedded-opentype");
src: local("Segoe UI Semibold"),url("https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/semibold/latest.woff2") format("woff"),url("https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/semibold/latest.woff") format("woff"),url("https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/semibold/latest.ttf") format("truetype"),url("https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/semibold/latest.svg#web") format("svg");
font-weight: 600
}
@font-face {
font-family: 'Segoe UI';
src: url("https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/bold/latest.eot"),url("https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/bold/latest.eot?#iefix") format("embedded-opentype");
src: local("Segoe UI Bold"),url("https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/bold/latest.woff2") format("woff"),url("https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/bold/latest.woff") format("woff"),url("https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/bold/latest.ttf") format("truetype"),url("https://c.s-microsoft.com/static/fonts/segoe-ui/west-european/bold/latest.svg#web") format("svg");
font-weight: 700
body:not(.error) .error-message {
display: none;
}

View File

@@ -10,16 +10,22 @@
</head>
<body>
<a class="branding app-name" href="https://code.visualstudio.com/"></a>
<div class="message-container">
<div class="message">
Sign-in successful! Returning to <span class="app-name"></span>...
<br><br>
If you're not redirected automatically, <a href="#" id="fallback-link">click here</a> or close this page.
</div>
<div class="error-message">
An error occurred while signing in:
<div class="error-text"></div>
<div class="container">
<div class="content">
<div class="icon-container">
<img src="code-icon.svg" class="vscode-icon">
</div>
<h1 class="title">Launching <span class="app-name"></span></h1>
<div class="message">
<div class="success-message">
<p class="subtitle">You will be redirected in a few moments.</p>
<p class="detail">If nothing happens, <a href="#" id="fallback-link">open this link in your browser</a>.</p>
</div>
<div class="error-message">
<p class="subtitle">An error occurred while signing in:</p>
<div class="detail"></div>
</div>
</div>
</div>
</div>
<script>
@@ -30,10 +36,8 @@
const error = urlParams.get('error');
const redirectUri = urlParams.get('redirect_uri');
if (error) {
document.querySelector('.error-text')
.textContent = error;
document.querySelector('body')
.classList.add('error');
document.querySelector('.error-message > .detail').textContent = error;
document.querySelector('body').classList.add('error');
} else if (redirectUri) {
// Set up the fallback link
const fallbackLink = document.getElementById('fallback-link');