diff --git a/templates/settings.gohtml b/templates/settings.gohtml
index 40f3551..bd61a66 100644
--- a/templates/settings.gohtml
+++ b/templates/settings.gohtml
@@ -113,14 +113,30 @@
{{end}}
diff --git a/web/auth.go b/web/auth.go
index 36954b0..ff3abc1 100644
--- a/web/auth.go
+++ b/web/auth.go
@@ -99,7 +99,7 @@ func createAccount(w http.ResponseWriter, r *http.Request) {
Value: sessionID,
Path: "/",
HttpOnly: true,
- Secure: true,
+ Secure: false,
SameSite: http.SameSiteLaxMode,
MaxAge: 86400 * 30,
})
@@ -157,7 +157,7 @@ func loginSubmit(w http.ResponseWriter, r *http.Request) {
Value: sessionID,
Path: "/",
HttpOnly: true,
- Secure: true,
+ Secure: false,
SameSite: http.SameSiteLaxMode,
MaxAge: 86400 * 30,
})
diff --git a/web/settings.go b/web/settings.go
index f3b6925..7142132 100644
--- a/web/settings.go
+++ b/web/settings.go
@@ -99,7 +99,7 @@ func generateAPIKeyHandler(w http.ResponseWriter, r *http.Request) {
return
}
- http.Redirect(w, r, "/settings", http.StatusSeeOther)
+ http.Redirect(w, r, "/settings?tab=scrobble", http.StatusSeeOther)
}
func updateSpotifyCredentialsHandler(w http.ResponseWriter, r *http.Request) {
@@ -132,7 +132,7 @@ func updateSpotifyCredentialsHandler(w http.ResponseWriter, r *http.Request) {
}
}
- http.Redirect(w, r, "/settings", http.StatusSeeOther)
+ http.Redirect(w, r, "/settings?tab=scrobble", http.StatusSeeOther)
}
func spotifyConnectHandler(w http.ResponseWriter, r *http.Request) {
@@ -151,15 +151,15 @@ func spotifyConnectHandler(w http.ResponseWriter, r *http.Request) {
user, err := scrobble.GetUserById(userId)
if err != nil {
fmt.Fprintf(os.Stderr, "spotifyConnectHandler: GetUserById error: %v\n", err)
- http.Redirect(w, r, "/settings", http.StatusSeeOther)
+ http.Redirect(w, r, "/settings?tab=scrobble", http.StatusSeeOther)
return
}
- fmt.Fprintf(os.Stderr, "spotifyConnectHandler: userId=%d, SpotifyClientId=%v\n", userId, user.SpotifyClientId)
+ fmt.Fprintf(os.Stderr, "spotifyConnectHandler: SpotifyClientId is nil or empty, redirecting to settings\n")
if user.SpotifyClientId == nil || *user.SpotifyClientId == "" {
fmt.Fprintf(os.Stderr, "spotifyConnectHandler: SpotifyClientId is nil or empty, redirecting to settings\n")
- http.Redirect(w, r, "/settings", http.StatusSeeOther)
+ http.Redirect(w, r, "/settings?tab=scrobble", http.StatusSeeOther)
return
}