update auth cookie settings

This commit is contained in:
Wim Brand
2020-02-05 11:35:31 +01:00
parent 2fba11269a
commit 650c7ede6c
4 changed files with 21 additions and 16 deletions

View File

@@ -64,7 +64,10 @@ func (wc *WebController) newTemplateData(w http.ResponseWriter, r *http.Request)
log.Debug("Session check for key '%s' failed: %s", key, err)
if err.Error() == "authentication_required" || err.Error() == "authentication_failed" {
// This key is invalid, delete it
// Disable API authentication
t.PixelAPI.APIKey = ""
// Remove the authentication cookie
log.Debug("Deleting invalid API key")
http.SetCookie(w, &http.Cookie{
Name: "pd_auth_key",