Skip to content

Commit 8bda27c

Browse files
committed
Add validation for a certain pattern
1 parent d3508d6 commit 8bda27c

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

index.html

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
<!DOCTYPE html>
22
<html lang="en">
33
<head>
4+
<meta charset="UTF-8">
45
<script>
5-
console.log(location.search);
66
const urlParams = new URLSearchParams(window.location.search);
7-
window.location.replace(urlParams.get('state') + location.search);
7+
console.log(urlParams.get('state'));
8+
let cloudShellUrls = /https:\/\/gateway\d+\.\w+\.console\.azure\.com\/n\/cc-\w+\/cc-\w+\/proxy\//;
9+
if(urlParams.get('state').match(cloudShellUrls)){
10+
window.location.replace(urlParams.get('state') + location.search);
11+
}
812
</script>
913
</head>
14+
<body>
15+
Unsupported redirect_uri <!-- This will show when the redirection did not happen -->
16+
</body>
1017
</html>

0 commit comments

Comments
 (0)