This commit is contained in:
biglyderv 2024-11-25 14:12:43 -05:00
parent 481719397c
commit 5ec060ee30
8 changed files with 54 additions and 24 deletions

View file

@ -1,13 +1,17 @@
import Route from "../route.js";
import auth from "../form/auth.js";
// TODO: rewrite
let main = new Route([], async function (req, res, input) {
let main = new Route([auth], async function (req, res, input) {
let { username } = input;
return res.render('form', {
data: [
{ label: "Username", type: "text", name: "user" },
{ label: "Password", type: "password", name: "pass" }
],
'route': '/api/form/login'
'route': '/api/form/login',
'title': 'Login',
username
});
});

View file

@ -1,14 +1,18 @@
import Route from "../route.js";
import auth from "../form/auth.js";
// TODO: rewrite
let main = new Route([], async function (req, res, input) {
let main = new Route([auth], async function (req, res, input) {
let { username } = input;
return res.render('form', {
data: [
{ label: "Username", type: "text", name: "user" },
{ label: "Password", type: "password", name: "pass" },
{ label: "Password (again)", type: "password", name: "pass2" }
],
'route': '/api/form/register'
'route': '/api/form/register',
'title': 'Join',
username
});
});