mirror of
https://github.com/MrTalon63/NeoMap.git
synced 2026-01-11 03:49:13 +01:00
This commit is contained in:
parent
101efa2605
commit
97101cfcc3
1 changed files with 3 additions and 10 deletions
|
|
@ -37,11 +37,6 @@ app.get("/auth/logout", async (c) => {
|
|||
return c.json({ status: 200, message: "OK" });
|
||||
});
|
||||
|
||||
app.get("/auth/login", async (c) => {
|
||||
const auth = await getAuth(c);
|
||||
return c.json({ status: 200, message: "OK", data: auth });
|
||||
});
|
||||
|
||||
app.get("/auth/callback", async (c: Context) => {
|
||||
c.set("oidcClaimsHook", oidcClaimsHook);
|
||||
return processOAuthCallback(c);
|
||||
|
|
@ -50,12 +45,10 @@ app.get("/auth/callback", async (c: Context) => {
|
|||
app.use(logger(), compress());
|
||||
app.use("/", serveStatic({ root: "./public" }));
|
||||
app.use("/auth/*", oidcAuthMiddleware());
|
||||
app.use("/auth/*", async (c, next) => {
|
||||
|
||||
app.get("/auth/login", async (c) => {
|
||||
const auth = await getAuth(c);
|
||||
if (!auth) {
|
||||
return c.json({ status: 401, message: "Unauthorized" }, 401);
|
||||
}
|
||||
await next();
|
||||
return c.json({ status: 200, message: "OK", data: auth });
|
||||
});
|
||||
|
||||
app.route("/", api);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue