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;
// } else if (uid) {
const bytes = CryptoJS.AES.decrypt(uid, secretKey);
const decrypted = bytes.toString(CryptoJS.enc.Utf8);
const username = decrypted;
// }
let username = "";
if (req.body.serve === 'sso') {
const bytes = CryptoJS.AES.decrypt(uid, secretKey);
const decrypted = bytes.toString(CryptoJS.enc.Utf8);
username = decrypted;
} else {
username = uid;
}
// const oldssotoken = cookies['oldssotoken'];
const olduid = cookies['olduid'];