Skip to content

Commit

Permalink
Check callback url
Browse files Browse the repository at this point in the history
  • Loading branch information
mei23 authored and fs5m8 committed Feb 10, 2023
1 parent 88d237a commit 1f6ae07
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/client/app/auth/views/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ export default Vue.extend({
accepted() {
this.state = 'accepted';
if (this.session.app.callbackUrl) {
const url = new URL(this.session.app.callbackUrl);
if (['javascript:', 'file:', 'data:', 'mailto:', 'tel:'].includes(url.protocol)) throw new Error('invalid url');
location.href = `${this.session.app.callbackUrl}?token=${this.session.token}`;
}
}
Expand Down

0 comments on commit 1f6ae07

Please sign in to comment.