Skip to content

Commit

Permalink
[api] remove /logout route (do not implement front channel logout) (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
freemvmt authored Oct 10, 2024
1 parent ff74183 commit 39ae01b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 17 deletions.
8 changes: 0 additions & 8 deletions api.planx.uk/modules/auth/controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,6 @@ export const failedLogin: RequestHandler = (_req, _res, next) =>
message: "User failed to authenticate",
});

export const logout: RequestHandler = (req, res) => {
// TODO: implement dual purpose as Microsoft frontend logout channel
req.logout(() => {
// do nothing
});
res.redirect(process.env.EDITOR_URL_EXT!);
};

export const handleSuccess = (req: Request, res: Response) => {
if (!req.user) {
return res.json({
Expand Down
23 changes: 16 additions & 7 deletions api.planx.uk/modules/auth/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@ tags:
- name: auth
description: Authentication related requests
paths:
/logout:
get:
summary: Logout from the PlanX service
tags: ["auth"]
responses:
"302":
description: Redirect to PlanX Editor
/auth/login/failed:
get:
summary: Failed login
Expand Down Expand Up @@ -44,3 +37,19 @@ paths:
responses:
"200":
description: OK
/auth/microsoft:
get:
summary: Authenticate via Microsoft SSO
description: The first step in Microsoft authentication will involve redirecting the user to login.microsoftonline.com
tags: ["auth"]
responses:
"200":
description: OK
/auth/microsoft/callback:
get:
summary: Generate a JWT for an authenticated user
description: After authentication, Microsoft will redirect the user back to this route which generates a JWT for the user
tags: ["auth"]
responses:
"200":
description: OK
2 changes: 0 additions & 2 deletions api.planx.uk/modules/auth/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import * as Controller from "./controller.js";
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

0 comments on commit 39ae01b

Please sign in to comment.