Skip to content

Commit

Permalink
core: fix js redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
koush committed Oct 12, 2023
1 parent af6e18d commit ee68fcd
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
4 changes: 2 additions & 2 deletions plugins/core/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion plugins/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@scrypted/core",
"version": "0.1.142",
"version": "0.1.143",
"description": "Scrypted Core plugin. Provides the UI, websocket, and engine.io APIs.",
"author": "Scrypted",
"license": "Apache-2.0",
Expand Down
10 changes: 10 additions & 0 deletions plugins/core/ui/src/Login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,16 @@ export default {
try {
const redirect_uri = new URL(window.location).searchParams.get('redirect_uri');
if (redirect_uri) {
try {
const parsed = new URL(redirect_uri);
// allow everything but javascript evaluation within this browser (ie, custom uri handlers, https, etc are all valid)
if (parsed.protocol === 'javascript:') {
window.location = '/';
return;
}
}
catch (e) {
}
window.location = redirect_uri;
return;
}
Expand Down

0 comments on commit ee68fcd

Please sign in to comment.