mirror of
https://github.com/apricote/Listory.git
synced 2026-01-13 21:21:02 +00:00
feat: implement long-lived sessions
This commit is contained in:
parent
d0705afca8
commit
44f7e26270
35 changed files with 739 additions and 190 deletions
16
src/cookie-parser/cookie-parser.middleware.ts
Normal file
16
src/cookie-parser/cookie-parser.middleware.ts
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
import { Injectable, NestMiddleware } from "@nestjs/common";
|
||||
import * as cookieParser from "cookie-parser";
|
||||
import type { RequestHandler } from "express";
|
||||
|
||||
@Injectable()
|
||||
export class CookieParserMiddleware implements NestMiddleware {
|
||||
private readonly middleware: RequestHandler;
|
||||
|
||||
constructor() {
|
||||
this.middleware = cookieParser();
|
||||
}
|
||||
|
||||
use(req: any, res: any, next: () => void) {
|
||||
return this.middleware(req, res, next);
|
||||
}
|
||||
}
|
||||
1
src/cookie-parser/index.ts
Normal file
1
src/cookie-parser/index.ts
Normal file
|
|
@ -0,0 +1 @@
|
|||
export { CookieParserMiddleware } from "./cookie-parser.middleware";
|
||||
Loading…
Add table
Add a link
Reference in a new issue