fix: remove lamassu login-related filtering
fix: use logger instead of console
This commit is contained in:
parent
b9114b6a33
commit
2ff9ac5bcd
7 changed files with 11 additions and 46 deletions
|
|
@ -1,6 +1,7 @@
|
|||
const { asyncLocalStorage } = require('../../async-storage')
|
||||
const db = require('../../db')
|
||||
const { USER_SESSIONS_TABLE_NAME } = require('../../constants')
|
||||
const logger = require('../../logger')
|
||||
|
||||
const schemaCache = {}
|
||||
|
||||
|
|
@ -11,7 +12,7 @@ const cleanUserSessions = (cleanInterval) => (req, res, next) => {
|
|||
if (!schema) return next()
|
||||
if (schema && schemaCache.schema + cleanInterval > now) return next()
|
||||
|
||||
console.log('Clearing expired sessions for schema', schema)
|
||||
logger.debug(`Clearing expired sessions for schema ${schema}`)
|
||||
return db.none('DELETE FROM $1^ WHERE expire < to_timestamp($2 / 1000.0)', [USER_SESSIONS_TABLE_NAME, now])
|
||||
.then(() => {
|
||||
schemaCache.schema = now
|
||||
|
|
|
|||
|
|
@ -20,13 +20,9 @@ const getSecret = () => {
|
|||
|
||||
const hostname = options.hostname
|
||||
|
||||
const lamaDb = {
|
||||
query: (query, values, qrm) => db.query(query, values, qrm, false)
|
||||
}
|
||||
|
||||
router.use('*', session({
|
||||
store: new PgSession({
|
||||
pgPromise: lamaDb,
|
||||
pgPromise: db,
|
||||
tableName: USER_SESSIONS_TABLE_NAME
|
||||
}),
|
||||
name: 'lamassu_sid',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue