let express = require('express')
let router = express.Router()
const auth = require('../lib/auth')

let { User } = require('../models')

router.get('/users', auth, async(req, res, next) => {
    try {
        let users = await User.findAll({
            where: {
                username
            },
            order: [ ['username', 'DESC'] ],
            attributes: { exclude: ['hash', 'email', 'emailVerified', 'koins', 'currency2', 'emailToken', 'passwordResetExpiry', 'passwordResetToken', 'experimentMode', 'developerMode', 'cookieOptOut', 'deleteCode', 'jwtOffset'] },
            offset
        })

    } catch (e) { next(e) }
})

module.exports = router
