fix: align session expiry and WebDAV move permissions
This commit is contained in:
@@ -425,7 +425,7 @@ func (s *Server) session(w http.ResponseWriter, r *http.Request) {
|
||||
writeJSONError(w, http.StatusNotFound, "user or password is wrong")
|
||||
return
|
||||
}
|
||||
token, err := auth.NewToken(a.Username)
|
||||
token, err := auth.NewToken(a.Username, s.SessionTimeout)
|
||||
if err != nil {
|
||||
writeJSONError(w, http.StatusInternalServerError, "failed to create token")
|
||||
return
|
||||
@@ -1447,7 +1447,9 @@ func (f *webdavAuthFS) Copy(ctx context.Context, name, dest string, opts *webdav
|
||||
return f.inner.Copy(ctx, name, dest, opts)
|
||||
}
|
||||
func (f *webdavAuthFS) Move(ctx context.Context, name, dest string, opts *webdav.MoveOptions) (bool, error) {
|
||||
if err := f.allow(name, auth.Delete); err != nil {
|
||||
// CHFS treats MOVE as a write operation on the source; W already
|
||||
// includes read permission and does not require explicit delete permission.
|
||||
if err := f.allow(name, auth.Write); err != nil {
|
||||
return false, err
|
||||
}
|
||||
parent := path.Dir(webdavAuthPath(dest))
|
||||
|
||||
Reference in New Issue
Block a user