mirror of
https://github.com/fosrl/pangolin.git
synced 2025-08-29 14:18:26 +02:00
organized routes and routes and added rate limiter
This commit is contained in:
parent
f1e77dfe42
commit
1a91dbb89c
45 changed files with 241 additions and 181 deletions
|
@ -9,7 +9,7 @@ const adapter = new DrizzleSQLiteAdapter(db, sessions, users);
|
|||
export const lucia = new Lucia(adapter, {
|
||||
getUserAttributes: (attributes) => {
|
||||
return {
|
||||
username: attributes.username,
|
||||
email: attributes.email,
|
||||
};
|
||||
},
|
||||
// getSessionAttributes: (attributes) => {
|
||||
|
@ -19,7 +19,7 @@ export const lucia = new Lucia(adapter, {
|
|||
// },
|
||||
sessionCookie: {
|
||||
name: "session",
|
||||
expires: false, // session cookies have very long lifespan (2 years)
|
||||
expires: false,
|
||||
attributes: {
|
||||
secure: environment.ENVIRONMENT === "prod",
|
||||
sameSite: "strict",
|
||||
|
@ -31,7 +31,6 @@ export const lucia = new Lucia(adapter, {
|
|||
|
||||
export default lucia;
|
||||
|
||||
// IMPORTANT!
|
||||
declare module "lucia" {
|
||||
interface Register {
|
||||
Lucia: typeof lucia;
|
||||
|
@ -41,7 +40,7 @@ declare module "lucia" {
|
|||
}
|
||||
|
||||
interface DatabaseUserAttributes {
|
||||
username: string;
|
||||
email: string;
|
||||
passwordHash: string;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue