Fix authentication for regular users by validating JWT tokens

Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]andwhyour committed 2025-11-10 18:10:16 +00:00
1 parent bf9be821ba
commit 6aefc61be6
2 files changed
+43 -14

No files matched your search

+7
View File
@@ -88,6 +88,13 @@ export default ({ app }: { app: Application }) => {
return next();
}
// If JWT has been successfully verified by expressjwt middleware, allow the request
// This handles regular users whose tokens are not stored in authInfo
if (req.auth) {
return next();
}
// For system admin, also check against stored token
const authInfo = await shareStore.getAuthInfo();
if (authInfo && headerToken) {
const { token = '', tokens = {} } = authInfo;