mirror of
https://github.com/hpware/news-analyze.git
synced 2025-06-23 13:04:23 +00:00
Mainly make the python code to make it javascript for nuxt to access.
Python is just used for testing stuff, as it is a fine lang to do so.
This commit is contained in:
parent
81012f5061
commit
5f78e8c58a
9 changed files with 71 additions and 2 deletions
|
@ -1,3 +1,24 @@
|
|||
export default defineEventHandler(async (event) => {
|
||||
return "logging out...";
|
||||
const loginCookie = getCookie(event, "session");
|
||||
const lastCheckCookie = getCookie(event, "last_check");
|
||||
const nowDate = new Date().toLocaleString();
|
||||
try {
|
||||
if (loginCookie) {
|
||||
deleteCookie(event, "session");
|
||||
setCookie(event, "lastCheckCookie", nowDate, {
|
||||
httpOnly: true,
|
||||
secure: process.env.NODE_ENV === "production",
|
||||
path: "/",
|
||||
});
|
||||
return {
|
||||
success: true,
|
||||
error: null,
|
||||
};
|
||||
}
|
||||
} catch (e) {
|
||||
return {
|
||||
success: false,
|
||||
error: e.message,
|
||||
};
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue