Skip to content
This repository has been archived by the owner on Jan 7, 2025. It is now read-only.

Commit

Permalink
Update index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelveldt authored Aug 19, 2024
1 parent bc53dc4 commit f247a17
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
'use strict';
const urlParams = new URLSearchParams(window.location.search);
const redirect_url = decodeURIComponent(urlParams.get('state') || '');
const validOrigin = document.referrer.contains('spotify.com');
console.log('referrer', document.referrer);
const validOrigin = !document.referrer || document.referrer.contains('spotify.com');
const validDest = redirect_url.contains(':') && redirect_url.contains('/callback/');
if (validOrigin && validDest)
{
Expand Down

0 comments on commit f247a17

Please sign in to comment.