don't verify empty cookies
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
b2fc689bdc
commit
dee173cc63
|
@ -169,7 +169,7 @@ func VerifySessionContinuation(context *RequestContext, req *http.Request, resp
|
||||||
user, userErr := getUserFromAuthHeader(context.DBConn, authHeader)
|
user, userErr := getUserFromAuthHeader(context.DBConn, authHeader)
|
||||||
|
|
||||||
sessionCookie, err := req.Cookie("session")
|
sessionCookie, err := req.Cookie("session")
|
||||||
if err == nil {
|
if err == nil && sessionCookie.Value != "" {
|
||||||
user, userErr = getUserFromSession(context.DBConn, sessionCookie.Value)
|
user, userErr = getUserFromSession(context.DBConn, sessionCookie.Value)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -180,6 +180,8 @@ func VerifySessionContinuation(context *RequestContext, req *http.Request, resp
|
||||||
Name: "session",
|
Name: "session",
|
||||||
MaxAge: 0, // reset session cookie in case
|
MaxAge: 0, // reset session cookie in case
|
||||||
})
|
})
|
||||||
|
|
||||||
|
context.User = nil
|
||||||
return failure(context, req, resp)
|
return failure(context, req, resp)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue