Skip to content

Commit

Permalink
fix: lint + console.error
Browse files Browse the repository at this point in the history
  • Loading branch information
rdubigny committed May 2, 2024
1 parent 4638e5f commit a6e9eaa
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ const app = express();
app.set("view engine", "ejs");
app.use(
session({
secret: process.env.SESSION_SECRET,
name: "mcp_session",
})
secret: process.env.SESSION_SECRET,
}),
);
app.use(morgan("combined"));

Expand Down Expand Up @@ -86,14 +86,14 @@ app.post(
"/select-organization",
getAuthorizationControllerFactory({
prompt: "select_organization",
})
}),
);

app.post(
"/update-userinfo",
getAuthorizationControllerFactory({
prompt: "update_userinfo",
})
}),
);

app.post(
Expand All @@ -103,7 +103,7 @@ app.post(
prompt: "login",
// alternatively, you can use the 'max_age: 0'
// if so, claims parameter is not necessary as auth_time will be returned
})
}),
);

app.get(process.env.CALLBACK_URL, async (req, res, next) => {
Expand All @@ -123,15 +123,14 @@ app.get(process.env.CALLBACK_URL, async (req, res, next) => {
req.session.oauth2token = tokenSet;
res.redirect("/");
} catch (e) {
console.error(e)
next(e);
}
});

app.post("/logout", async (req, res, next) => {
try {
const id_token_hint = req.session.id_token_hint;
req.session.destroy()
req.session.destroy();
const client = await getMcpClient();
const redirectUrl = client.endSessionUrl({
post_logout_redirect_uri: `${origin}/`,
Expand Down

0 comments on commit a6e9eaa

Please sign in to comment.