15 lines
384 B
TypeScript
15 lines
384 B
TypeScript
|
import Module from '../Module.ts'
|
||
|
import Kernel from '../Kernel.ts'
|
||
|
import {Request} from '../../Request.ts'
|
||
|
|
||
|
export default class PersistSession extends Module {
|
||
|
public static register(kernel: Kernel) {
|
||
|
kernel.register(this).last()
|
||
|
}
|
||
|
|
||
|
public async apply(request: Request): Promise<Request> {
|
||
|
await request.session.persist()
|
||
|
return request
|
||
|
}
|
||
|
}
|