fix(auth/property): resolve auth token resolution, add property seeder
deploy-chabokan / deploy (push) Canceled after 0s
deploy-chabokan / deploy (push) Canceled after 0s
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user