Fix error check

This commit is contained in:
Wim Brand
2019-03-28 11:39:13 +01:00
parent 1138fd0eea
commit 1609b8cb9a

View File

@@ -44,7 +44,7 @@ func (wc *WebController) newTemplateData(w http.ResponseWriter, r *http.Request)
// cannot be authenticated
log.Debug("Session check for key '%s' failed: %s", key, err)
if aerr, ok := err.(pixelapi.Error); ok && aerr.Value == "authentication_required" {
if err.Error() == "authentication_required" || err.Error() == "authentication_failed" {
// This key is invalid, delete it
log.Debug("Deleting invalid API key")
http.SetCookie(w, &http.Cookie{