Updated profile and post capabilities
This commit is contained in:
@@ -11,17 +11,20 @@ const allowedOrigins = (process.env.CORS_ALLOWED_ORIGINS || "")
|
||||
.filter(Boolean);
|
||||
|
||||
// Apply configured CORS origins to every endpoint, including preflight requests.
|
||||
app.use(cors({ origin: allowedOrigins }));
|
||||
app.use(cors({ origin: allowedOrigins, credentials: true }));
|
||||
app.use(express.json());
|
||||
|
||||
// People routes
|
||||
const CreatePersonRoute = require("./features/people/REGISTER_people");
|
||||
const LoginPersonRoute = require("./features/people/LOGIN_people");
|
||||
const VerifyAuthRoute = require("./features/people/VERIFY_auth");
|
||||
|
||||
app.use("/auth/register", CreatePersonRoute);
|
||||
app.use("/auth/login", LoginPersonRoute);
|
||||
app.use("/auth/me", VerifyAuthRoute);
|
||||
app.use("/auth/verify", VerifyAuthRoute);
|
||||
|
||||
// Every route below this point requires a valid JWT. Registration and login stay public.
|
||||
// Every route below this point requires a valid JWT or session cookie. Registration and login stay public.
|
||||
app.use(authenticateToken);
|
||||
|
||||
// Relation routes
|
||||
|
||||
Reference in New Issue
Block a user