login and register logic

This commit is contained in:
biglyderv 2025-02-25 19:47:28 -05:00
parent a2f8452eec
commit 8d0c02e27e
Signed by: biglyderv
GPG key ID: 0E2EB0B4CD7397B5
15 changed files with 496 additions and 106 deletions

58
routes/you.js Normal file
View file

@ -0,0 +1,58 @@
import { Router } from "express";
const router = Router();
router.get('/login', (req, res, next) => {
res.ctx.mainPage = 'form'
res.ctx.mainCtx = {
title: "Log in",
message: 'Log into an existing account.',
action: "/api/form/you/login",
inputs: [
{
"key": "Username",
"type": "text",
"name": "user",
"default": ""
},
{
"key": "Password",
"type": "password",
"name": "pass",
"default": ""
}
]
}
next();
})
router.get('/new', (req, res, next) => {
res.ctx.mainPage = 'form'
res.ctx.mainCtx = {
title: "Register",
message: 'Create an account and join the community!',
action: "/api/form/you/new",
inputs: [
{
"key": "Username",
"type": "text",
"name": "user",
"default": ""
},
{
"key": "Password",
"type": "password",
"name": "pass",
"default": ""
},
{
"key": "Password (again)",
"type": "password",
"name": "pass2",
"default": ""
}
]
}
next();
})
export default router;