fix(auth/property): resolve auth token resolution, add property seeder
deploy-chabokan / deploy (push) Canceled after 0s

This commit is contained in:
2026-08-19 07:08:36 +03:30
parent 284594c782
commit 95c0532374
4 changed files with 168 additions and 3 deletions
+8 -3
View File
@@ -8,10 +8,15 @@ exports.loginProtect = async (req, res, next) => {
let token
token = req.cookies['bm-token']
if (req.headers.authorization && req.headers.authorization.startsWith('Bearer')) {
token = req.headers.authorization.split(' ')[1]
const headerToken = req.headers.authorization.split(' ')[1]
if (headerToken && headerToken !== 'undefined' && headerToken !== 'null' && headerToken.trim() !== '') {
token = headerToken.trim()
}
}
if (!token && req.cookies) {
token = req.cookies['bm-token'] || req.cookies['belonging_token'] || req.cookies['jwt']
}
if (!token) {