fix(signin): Check for all available cookies instead of the count (#504)

This commit is contained in:
iLLeniumStudios 2023-04-26 14:18:28 +02:00 committed by GitHub
parent e2e7fcf218
commit 3a2e139292
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -48,9 +48,12 @@ func GetCookie(ctx context.Context, params api.ConfigParams, userPass string) (s
}
cookies := res.Cookies()
if len(cookies) != 1 {
return "", fmt.Errorf("failure getting session cookie, multiple cookies")
for _, cookie := range cookies {
if strings.Contains(cookie.Name, "influxdb") {
return cookie.Value, nil
}
}
return cookies[0].Value, nil
return "", fmt.Errorf("failure getting session cookie, invalid cookies")
}