From 5609e1b5302bee1670c4a8024bd018c478a08e9a Mon Sep 17 00:00:00 2001 From: Zuxxied Date: Sat, 19 Oct 2024 16:00:03 -0400 Subject: [PATCH] auth_api --- form/auth_api.js | 9 +++++++++ routes.js | 4 +++- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 form/auth_api.js diff --git a/form/auth_api.js b/form/auth_api.js new file mode 100644 index 0000000..0af2b6f --- /dev/null +++ b/form/auth_api.js @@ -0,0 +1,9 @@ +import Route from "../route.js"; +import auth from "../form/auth.js"; + +let main = new Route([auth], async function (req, res, input) { + let { username, valid } = input; + res.send({ username, valid }); +}); + +export default main; \ No newline at end of file diff --git a/routes.js b/routes.js index 23366d4..491a659 100644 --- a/routes.js +++ b/routes.js @@ -12,6 +12,7 @@ import uploadB from "./form/upload.js"; import commentB from "./form/comment.js"; import settingsB from "./form/settings.js"; import auth from "./form/auth.js"; +import auth_api from "./form/auth_api.js"; import follow from './form/follow.js'; const routes = { @@ -40,7 +41,8 @@ routes.form = { auth, comment: commentB, follow, - settings: settingsB + settings: settingsB, + auth_api }; async function iterate(req, res, index) {