WebDAV: Refactor internal/server/webdav_auth.go #782 #808

Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
Michael Mayer 2024-01-29 15:11:23 +01:00
parent 70f8c3be6c
commit 75e52a6bf5

View file

@ -92,7 +92,7 @@ func WebDAVAuth(conf *config.Config) gin.HandlerFunc {
}
// Allow webdav access based on the auth token or secret provided?
if sess, user, sid, cached := WebDAVAuthSession(c, authToken); cached && user != nil {
if sess, user, sid, cached := WebDAVAuthSession(c, authToken); user != nil && cached {
// Add user to request context and return to signal successful authentication.
c.Set(gin.AuthUserKey, user)
return