Have Loopback Server flow redirect back to VS Code and make it the primary flow (#251333)

* Have Loopback Server flow redirect back to VS Code and make it the primary flow

Fixes https://github.com/microsoft/vscode/issues/250086

* Fix test

* Fix test

* Fix other test
This commit is contained in:
Tyler James Leonhardt
2025-06-12 23:14:41 -07:00
committed by GitHub
parent 7766411d9f
commit 31620a3dec
5 changed files with 358 additions and 345 deletions

View File

@@ -23,13 +23,17 @@
</div>
</div>
<script>
var search = window.location.search;
var error = (/[?&^]error=([^&]+)/.exec(search) || [])[1];
var urlParams = new URLSearchParams(window.location.search);
var error = urlParams.get('error');
if (error) {
document.querySelector('.error-text')
.textContent = decodeURIComponent(error);
.textContent = error;
document.querySelector('body')
.classList.add('error');
} else if (urlParams.get('redirect_uri')) {
setTimeout(() => {
window.location = urlParams.get('redirect_uri');
}, 1000);
}
</script>
</body>