refactor(settings): removed the need to login to get the settings

This commit is contained in:
2025-03-19 17:17:36 -05:00
parent 316b27e3e0
commit 5945ace9f2

View File

@@ -52,25 +52,6 @@ app.openapi(
}),
async (c) => {
// make sure we have a vaid user being accessed thats really logged in
const authHeader = c.req.header("Authorization");
if (authHeader?.includes("Basic")) {
return c.json({message: "You are a Basic user! Please login to get a token"}, 401);
}
if (!authHeader) {
return c.json({message: "Unauthorized"}, 401);
}
const token = authHeader?.split("Bearer ")[1] || "";
let user: User;
try {
const payload = await verify(token, process.env.JWT_SECRET!);
user = payload.user as User;
} catch (error) {
return c.json({message: "Unauthorized"}, 401);
}
// now pass all the data over to update the user info
try {