mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Auth: Don't clear auth token cookie when lookup token fails (#32999)
If LookupToken fails we don't clear the auth token cookie. Ref #15316
This commit is contained in:
parent
3e3a0a1ea1
commit
747f3cd300
@ -259,12 +259,6 @@ func (h *ContextHandler) initContextWithToken(ctx *models.ReqContext, orgID int6
|
||||
token, err := h.AuthTokenService.LookupToken(ctx.Req.Context(), rawToken)
|
||||
if err != nil {
|
||||
ctx.Logger.Error("Failed to look up user based on cookie", "error", err)
|
||||
|
||||
var revokedErr *models.TokenRevokedError
|
||||
if !errors.As(err, &revokedErr) || !ctx.IsApiRequest() {
|
||||
cookies.WriteSessionCookie(ctx, h.Cfg, "", -1)
|
||||
}
|
||||
|
||||
ctx.Data["lookupTokenErr"] = err
|
||||
return false
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user