fixing
This commit is contained in:
parent
cecb85d066
commit
296e23c588
1 changed files with 54 additions and 54 deletions
20
sso.js
20
sso.js
|
|
@ -117,9 +117,9 @@ app.post("/api/v1/sso/kcauth", async (req, res) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
// const oldssotoken = cookies['oldssotoken'];
|
// const oldssotoken = cookies['oldssotoken'];
|
||||||
const olduid = cookies['olduid'];
|
// const olduid = cookies['olduid'];
|
||||||
|
|
||||||
if (username !== olduid) {
|
// if (username !== olduid) {
|
||||||
// create body for admin token
|
// create body for admin token
|
||||||
let body = {
|
let body = {
|
||||||
client_id: clientId,
|
client_id: clientId,
|
||||||
|
|
@ -170,16 +170,16 @@ app.post("/api/v1/sso/kcauth", async (req, res) => {
|
||||||
// httpOnly: true,
|
// httpOnly: true,
|
||||||
// });
|
// });
|
||||||
|
|
||||||
res.cookie('olduid', username, {
|
// res.cookie('olduid', username, {
|
||||||
maxAge: 1000 * 60 * 60 * 24, // กำหนด timeout หน่วยเป็น millisecond
|
// maxAge: 1000 * 60 * 60 * 24, // กำหนด timeout หน่วยเป็น millisecond
|
||||||
path: "/",
|
// path: "/",
|
||||||
httpOnly: true,
|
// httpOnly: true,
|
||||||
});
|
// });
|
||||||
|
|
||||||
res.status(200).send(tokenResponse.data);
|
res.status(200).send(tokenResponse.data);
|
||||||
} else {
|
// } else {
|
||||||
res.status(200).send({ isLogin: true });
|
// res.status(200).send({ isLogin: true });
|
||||||
}
|
// }
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// console.log("error===>", error);
|
// console.log("error===>", error);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue