Open reggi opened 5 years ago
Hi Reggi,
Try this: export class Session implements SessionEntity
Since this is still open I just wanted to mention that this is a typescript conflict that can be temporarily resolved with some type assertion.
Example:
const repository: Repository<SessionEntity> = (connection.getRepository(
Session
) as unknown) as Repository<SessionEntity>;
Then you can initialize your session like normal
Example:
app.use(
session({
secret: 'yoursuperdupersecret',
resave: false,
saveUninitialized: false,
store: new TypeormStore({ repository }),
cookie: {
maxAge: 3600000,
}
})