Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import Koa = require('koa');
import session = require('koa-session');
import * as ContextSession from "koa-session/lib/context";
import {
encode,
decode,
hash,
} from "koa-session/lib/util";
encode({ a: "b" });
decode("123");
hash("abc");
const app = new Koa();
app.use(session({
valid: (ctx, sess) => {
const { session: s } = ctx;
if (s) {
s.sess = "validated";
s.save();
return true;
}
return false;
},
store: {
get: async (key) => {
return "abc";