
import {
    User
} from "../../../../lib/database/connect.mjs";


export const get = async function (request, response) {
    if (request.getAuthState() != 'authenticated') {
        response.set('HX-Redirect', '/login').status(401).end();
        return;
    }

    let userList = await User.findAll();

    response.render(`views/htmx/admin/userTable.njk`, {
        userList: userList
    });
}