daton/lib/src/http/kernel/module/PersistSession.ts

15 lines
384 B
TypeScript
Raw Normal View History

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
}
}