Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v7.1.0
v7.3.0
4 changes: 3 additions & 1 deletion formsflow-forms-ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
- `Untested Features`: Newly introduced features or components that are yet to be thoroughly tested.
- `Upcoming Features`: Planned features or enhancements that will be available in future releases.
- `Known Issues`: Existing issues or problems that are acknowledged and will be addressed in subsequent updates.

# Version 7.3.0
### Fixed
- Fixed tenant key handling for authenticated vs anonymous users [FWF-5328].
# Version 7.1.0
### Added
- Added FORMIO_JWT_EXPIRE env for handling token expire time
Expand Down
9 changes: 7 additions & 2 deletions src/middleware/handleFormsList.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,15 @@ module.exports = function (router) {
}

if(process.env.MULTI_TENANCY_ENABLED == "true" && !req.isAdmin){
if(!req.token?.tenantKey){
// For anonymous users (no token), skip tenant key check for form submissions
// Only enforce tenant key for authenticated users
if(req.token && !req.token.tenantKey){
return res.sendStatus(401);
}
req.query.tenantKey = req.token.tenantKey
// Only set tenantKey if token exists and has tenantKey
if(req.token?.tenantKey){
req.query.tenantKey = req.token.tenantKey
}
}
// Merge any additional query parameters
req.query = { ...query, ...req.query };
Expand Down