Skip to content

Commit

Permalink
[api] minor edits
Browse files Browse the repository at this point in the history
  • Loading branch information
freemvmt committed Sep 5, 2024
1 parent 64b37d2 commit 92013f2
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 11 deletions.
4 changes: 4 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ SESSION_SECRET=👻
GOOGLE_CLIENT_ID=👻
GOOGLE_CLIENT_SECRET=👻

# Microsoft Azure OIDC credentials
MICROSOFT_CLIENT_ID=👻
MICROSOFT_CLIENT_SECRET=👻

# AWS credentials for uploading user files from local and pull request environments to a staging S3 bucket
AWS_S3_REGION=eu-west-2
AWS_S3_ACL=public-read
Expand Down
6 changes: 6 additions & 0 deletions api.planx.uk/modules/auth/controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ export const failedLogin: RequestHandler = (_req, _res, next) =>
});

export const logout: RequestHandler = (req, res) => {
console.log("Logging out due to request...");
console.log(req);

console.log("And the user specifically...");
console.log(req.user);

req.logout(() => {
// do nothing
});
Expand Down
2 changes: 1 addition & 1 deletion api.planx.uk/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"strict": true,
"target": "esnext",
"types": ["vitest/globals"],
// ensure the code is ready for transpilation by tsx/esbuild (used in dev)
// ensure the code is ready for per-file transpilation by tsx (used in dev mode)
"isolatedModules": true,
// TODO: implement "verbatimModuleSyntax" option (laborious)
},
Expand Down
7 changes: 0 additions & 7 deletions api.planx.uk/tsconfig.test.json

This file was deleted.

5 changes: 2 additions & 3 deletions editor.planx.uk/src/pages/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,11 @@ const Login: React.FC = () => {
</Box>
</LoginButton>
<LoginButton
disabled
variant="contained"
color="secondary"
href={`${
process.env.REACT_APP_MICROSOFT_OAUTH_OVERRIDE ??
process.env.REACT_APP_API_URL
import.meta.env.VITE_APP_MICROSOFT_OAUTH_OVERRIDE ??
import.meta.env.VITE_APP_API_URL
}/auth/microsoft`}
>
<Box component="span">
Expand Down

0 comments on commit 92013f2

Please sign in to comment.