AuthToken: client token rotation fix (#65709)

* AuthToken: respond with 401 if token is not found

* Set retry to one so we don't retry a failed token rotation
This commit is contained in:
Karl Persson
2023-03-31 16:44:08 +02:00
committed by GitHub
parent 355f47628f
commit 46cfb73e21
3 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -171,10 +171,10 @@ func TestHTTPServer_RotateUserAuthToken(t *testing.T) {
expectedStatus: http.StatusUnauthorized,
},
{
desc: "Should return 404 and when token s not found",
desc: "Should return 401 and when token not found",
cookie: &http.Cookie{Name: "grafana_session", Value: "123", Path: "/"},
rotatedErr: auth.ErrUserTokenNotFound,
expectedStatus: http.StatusNotFound,
expectedStatus: http.StatusUnauthorized,
},
{
desc: "Should return 200 and but not set new cookie if token was not rotated",