Skip to content

Commit 31620a3

Browse files
Have Loopback Server flow redirect back to VS Code and make it the primary flow (microsoft#251333)
* Have Loopback Server flow redirect back to VS Code and make it the primary flow Fixes microsoft#250086 * Fix test * Fix test * Fix other test
1 parent 7766411 commit 31620a3

File tree

5 files changed

+342
-329
lines changed

5 files changed

+342
-329
lines changed

extensions/github-authentication/media/index.html

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,17 @@
2323
</div>
2424
</div>
2525
<script>
26-
var search = window.location.search;
27-
var error = (/[?&^]error=([^&]+)/.exec(search) || [])[1];
26+
var urlParams = new URLSearchParams(window.location.search);
27+
var error = urlParams.get('error');
2828
if (error) {
2929
document.querySelector('.error-text')
30-
.textContent = decodeURIComponent(error);
30+
.textContent = error;
3131
document.querySelector('body')
3232
.classList.add('error');
33+
} else if (urlParams.get('redirect_uri')) {
34+
setTimeout(() => {
35+
window.location = urlParams.get('redirect_uri');
36+
}, 1000);
3337
}
3438
</script>
3539
</body>

0 commit comments

Comments
 (0)