This commit is contained in:
Warunee Tamkoo 2025-02-11 11:38:41 +07:00
parent 42184cb442
commit cecb85d066

12
sso.js
View file

@ -107,10 +107,14 @@ app.post("/api/v1/sso/kcauth", async (req, res) => {
// username = d.username; // username = d.username;
// } else if (uid) { // } else if (uid) {
const bytes = CryptoJS.AES.decrypt(uid, secretKey); let username = "";
const decrypted = bytes.toString(CryptoJS.enc.Utf8); if (req.body.serve === 'sso') {
const username = decrypted; const bytes = CryptoJS.AES.decrypt(uid, secretKey);
// } const decrypted = bytes.toString(CryptoJS.enc.Utf8);
username = decrypted;
} else {
username = uid;
}
// const oldssotoken = cookies['oldssotoken']; // const oldssotoken = cookies['oldssotoken'];
const olduid = cookies['olduid']; const olduid = cookies['olduid'];