diff --git a/api/api b/api/api index 4d69d63..f4c2222 100755 Binary files a/api/api and b/api/api differ diff --git a/api/main.go b/api/main.go index 36c321b..07d3b95 100644 --- a/api/main.go +++ b/api/main.go @@ -17,15 +17,15 @@ func generateRandomString(length int) string { } func main() { - err := godotenv.Load("../music/.env") - if err != nil { - log.Fatalf("Error loading .env file: %s", err) - } - client_id := os.Getenv("SPOTIFY_CLIENT_ID") - redirect_uri := "cs2440.joshashton.dev/music" + http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { + err := godotenv.Load("../music/.env") + if err != nil { + log.Fatalf("Error loading .env file: %s", err) + } - http.HandleFunc("/spotify-login", func(w http.ResponseWriter, r *http.Request) { + client_id := os.Getenv("SPOTIFY_CLIENT_ID") + redirect_uri := "https://cs2440.joshashton.dev/music" scope := "user-top-read" redirectURL := "https://accounts.spotify.com/authorize?" + strings.Join([]string{ diff --git a/music/index.php b/music/index.php index b28428b..581b497 100644 --- a/music/index.php +++ b/music/index.php @@ -2,7 +2,7 @@ session_start(); if (!isset($_GET['code'])) { - header('Location: https://api.joshashton.dev/spotify-login'); + header('Location: https://login.joshashton.dev/'); exit; } ?>