mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
Lotsa typescript bullshit
This commit is contained in:
parent
b7ac485689
commit
b927988017
65 changed files with 801 additions and 8447 deletions
|
@ -1,8 +1,14 @@
|
|||
const logger = require('../utils/logger.js')
|
||||
const utils = require('../utils/utils.js')
|
||||
const dbtools = require('../utils/dbtools.js')
|
||||
import logger from '../utils/logger'
|
||||
import utils from '../utils/utils'
|
||||
import dbtools from '../utils/dbtools'
|
||||
|
||||
module.exports = function(options) {
|
||||
interface Options {
|
||||
userDB: any
|
||||
jsonResponse: boolean
|
||||
exceptions: Array<string>
|
||||
}
|
||||
|
||||
export default function(options: Options): any {
|
||||
const { userDB, jsonResponse, exceptions } = options
|
||||
|
||||
const renderLogin = (req, res) => {
|
||||
|
@ -60,7 +66,7 @@ module.exports = function(options) {
|
|||
return
|
||||
}
|
||||
|
||||
const user = GetUserBySessionID(userDB, sessionID, req)
|
||||
const user = GetUserBySessionID(userDB, sessionID)
|
||||
|
||||
if (!user) {
|
||||
if (isException) {
|
||||
|
@ -127,7 +133,7 @@ function UpdateAccess(db, user, ip, sessionID) {
|
|||
}
|
||||
}
|
||||
|
||||
function GetUserBySessionID(db, sessionID, req) {
|
||||
function GetUserBySessionID(db: any, sessionID: string) {
|
||||
logger.DebugLog(`Getting user from db`, 'auth', 2)
|
||||
|
||||
const session = dbtools.Select(db, 'sessions', {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue