-แก้ไข นำระบบ ส่ง token ใน body ออก
This commit is contained in:
@@ -26,7 +26,7 @@ export class budgetAdd {
|
||||
let idx = -1
|
||||
let aryResult = []
|
||||
try {
|
||||
let token = req.body.request.token;
|
||||
let token = req.headers.authorization?.split(' ')[1];
|
||||
const decoded = verifyToken(token);
|
||||
|
||||
let name = req.body.request.bdgnam;
|
||||
|
||||
@@ -18,7 +18,7 @@ export class Interface {
|
||||
}
|
||||
|
||||
// ===============================================================
|
||||
// 📌 saveInterface → แกะ token เอง และ route ไปยัง interface เฉพาะ table
|
||||
// saveInterface → แกะ token เอง และ route ไปยัง interface เฉพาะ table
|
||||
// ===============================================================
|
||||
async saveInterface(tableName, data, req) {
|
||||
|
||||
@@ -45,7 +45,7 @@ export class Interface {
|
||||
return new sendError('Invalid token: ' + err.message)
|
||||
}
|
||||
|
||||
const schema = decoded.organization // ⭐ ได้ schema ที่ต้องการ
|
||||
const schema = decoded.organization
|
||||
if (!schema) return new sendError("Token missing 'organization' field")
|
||||
|
||||
// ------------------------------
|
||||
|
||||
Reference in New Issue
Block a user