Skip to content

Commit

Permalink
investigative logs for pizza
Browse files Browse the repository at this point in the history
  • Loading branch information
freemvmt committed Sep 6, 2024
1 parent 92013f2 commit 630caed
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
12 changes: 12 additions & 0 deletions api.planx.uk/modules/auth/controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,21 @@ export const logout: RequestHandler = (req, res) => {
console.log("And the user specifically...");
console.log(req.user);

const sid = req.query.sid;
const iss = req.query.iss;

console.log("SID: ", sid);
console.log("ISS: ", iss);

// split redirect for Microsoft front channel vs. internal logout (for former, return 200!)
if (req.query.sid) {
res.status(200).send("Logged out");
}

req.logout(() => {
// do nothing
});

res.redirect(process.env.EDITOR_URL_EXT!);
};

Expand Down
1 change: 1 addition & 0 deletions api.planx.uk/modules/auth/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export default (passport: Authenticator): Router => {
const router = Router();

router.get("/logout", Controller.logout);
// router.get("/auth/frontchannel-logout", Controller.frontChannelLogout)
router.get("/auth/login/failed", Controller.failedLogin);
router.get("/auth/google", Middleware.getGoogleAuthHandler(passport));
router.get(
Expand Down
4 changes: 4 additions & 0 deletions api.planx.uk/modules/auth/strategy/microsoft-oidc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ export const getMicrosoftOidcStrategy = (client: Client): Strategy<Client> => {
// TODO: use tokenSet.state to pass the redirectTo query param through the auth flow

const claims = tokenSet.claims();

console.log("claims:")
console.log(claims)

const email = claims.email;
const returned_nonce = claims.nonce;

Expand Down

0 comments on commit 630caed

Please sign in to comment.