mirror of
https://github.com/hpware/news-analyze.git
synced 2025-06-24 05:24:23 +00:00
Made a bunch of changes to the source code. And polish the deploying
process.
This commit is contained in:
parent
1200505451
commit
fc7b835d68
5 changed files with 72 additions and 20 deletions
|
@ -1,5 +1,5 @@
|
|||
// This should be hooked up to a database soon.
|
||||
import postgres from "~/server/components/postgres";
|
||||
import sql from "~/server/components/postgres";
|
||||
|
||||
// Parse Date Function
|
||||
function checkDate(dateString: string) {
|
||||
|
@ -40,8 +40,25 @@ export default defineEventHandler(async (event) => {
|
|||
path: "/",
|
||||
});
|
||||
}
|
||||
if (!loginCookie) {
|
||||
setCookie(event, "lastCheckCookie", nowDate, {
|
||||
httpOnly: true,
|
||||
secure: process.env.NODE_ENV === "production",
|
||||
path: "/",
|
||||
});
|
||||
return {
|
||||
auth: false,
|
||||
user: null,
|
||||
};
|
||||
}
|
||||
const loginCookieStore = atob(loginCookie);
|
||||
/*const findUser = sql`
|
||||
select * from userlogintokens
|
||||
where token = ${loginCookieStore}
|
||||
`;*/
|
||||
return {
|
||||
auth: true,
|
||||
user: "testing",
|
||||
loginCookie: loginCookieStore, // Debug
|
||||
};
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue