Websocket working and newt auth working

This commit is contained in:
Owen Schwartz 2024-11-10 17:08:29 -05:00
parent 4b82e90936
commit 4d0cfe07b7
8 changed files with 147 additions and 8 deletions

View file

@ -24,6 +24,7 @@ import {
import { verifyUserHasAction } from "./auth/verifyUserHasAction";
import { ActionsEnum } from "@server/auth/actions";
import { verifyUserIsOrgOwner } from "./auth/verifyUserIsOrgOwner";
import { createNewt, getToken } from "./newt";
// Root routes
export const unauthenticated = Router();
@ -353,6 +354,8 @@ authenticated.delete(
// role.removeRoleAction
// );
authenticated.put("/newt", createNewt);
// Auth routes
export const authRouter = Router();
unauthenticated.use("/auth", authRouter);
@ -367,6 +370,8 @@ authRouter.use(
authRouter.put("/signup", auth.signup);
authRouter.post("/login", auth.login);
authRouter.post("/logout", auth.logout);
authRouter.post('/newt/get-token', getToken);
authRouter.post("/2fa/enable", verifySessionUserMiddleware, auth.verifyTotp);
authRouter.post(
"/2fa/request",