Skip to content

Commit

Permalink
fixed location detection
Browse files Browse the repository at this point in the history
  • Loading branch information
aidenhuynh committed Nov 6, 2023
1 parent 919cb54 commit 70d2e69
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions assets/classroom/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -534,8 +534,8 @@ let codeVerifier2 = localStorage.getItem('code_verifier');
const urlParams = new URLSearchParams(window.location.search);
let code = urlParams.get('code');
var redirectUri = "";
var siteUrl = "{{ site.url }}"
if (siteUrl.includes("localhost")){
var site_url = location.href
if (site_url.includes("localhost") || site_url.includes("127.0.0.1")){
redirectUri = 'http://127.0.0.1:4100/classroom';
}
else {
Expand Down
5 changes: 3 additions & 2 deletions spotifyconnect.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@

const clientId = 'a76d4532c6e14dd7bd7393e3fccc1185';
var redirectUri = "";
var url = "{{ site.url }}"
if (url.includes("localhost")){
var site_url = location.href

if (site_url.includes("localhost") || site_url.includes("127.0.0.1")){
redirectUri = 'http://127.0.0.1:4100/classroom';
}
else {
Expand Down

0 comments on commit 70d2e69

Please sign in to comment.