async checkByUsernameAndPassword (username, password) {
    const result = await db('users').where('username', username).select('*').first()

    if (result && result.password) {
      if (bcrypt.compareSync(password, result.password)) {
        await db('users').where('token', result.token).update('lastSeen', (new Date()).getTime())

        return {
          token: result.token,
          id: result.id
        }
      }
    }

    return {}
  }
Check by username and password

@param {String} username username
@param {String} password password

@returns {Object} token and uid