Open
Description
⚠️ This issue respects the following points: ⚠️
- This is a bug, not a question or a configuration issue.
- This issue is not already reported on Github (I've searched it).
Bug description
Our pre login webhook returns a user definition every single time. sftpgo maps this user with an existing user in its database. That part works fine apart from VirtualFolder fs config. In the second login it falls back to LocalFileSystem.
After debugging, I found a mapping is missing on validation here
Current state:
virtualFolders = append(virtualFolders, vfs.VirtualFolder{
BaseVirtualFolder: vfs.BaseVirtualFolder{
Name: v.Name,
},```
Fix:
```go
virtualFolders = append(virtualFolders, vfs.VirtualFolder{
BaseVirtualFolder: vfs.BaseVirtualFolder{
Name: v.Name,
FsConfig: v.FsConfig,
},
Alternative solution user id should be persisted on webhook side and after every login the same userid should be sent.
Steps to reproduce
- Adjust a prelogin hook with virtul folder definitions apart from local.
- Connect
- Disconnect
- Connect again
- Virtual folder won't work because of missing FsConfig
Expected behavior
Virtual folders mapping should work.
SFTPGo version
2.6.5
Data provider
S3
Installation method
Community Docker image
Configuration
standard configuration
Relevant log output
What are you using SFTPGo for?
Medium business
Additional info
No response