fix some authentication cases

This commit is contained in:
David Christofas
2022-08-10 16:29:41 +02:00
parent 06ffd9cf8a
commit d271ae2451
2 changed files with 5 additions and 3 deletions

View File

@@ -41,6 +41,8 @@ var (
// _unprotectedPathPrefixes contains paths which don't need to be authenticated.
_unprotectedPathPrefixes = [...]string{
"/files",
"/data",
"/s/",
"/settings",
"/user-management",
"/.well-known",

View File

@@ -34,10 +34,10 @@ func (a PublicShareAuthenticator) Authenticate(r *http.Request) (*http.Request,
shareToken = query.Get(headerShareToken)
}
// Currently we only want to authenticate app open request coming from public shares.
if shareToken == "" {
// Don't authenticate
return nil, false
// If the share token is not set then we don't need to inject the user to
// the request context so we can just continue with the request.
return r, true
}
var sharePassword string