Skip to content

Commit

Permalink
Fixing Google OAuth issue (#399)
Browse files Browse the repository at this point in the history
  • Loading branch information
antoinejaussoin committed Apr 28, 2022
1 parent 10b9948 commit 97464e5
Show file tree
Hide file tree
Showing 14 changed files with 489 additions and 358 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ This will run a demo version, which you can turn into a fully licenced version b

## Versions History

### Version 4.16.0

- Fix the empty file download when logging using Google OAuth
- Upgrade the documentation to the latest version of Docusaurus
- Add more integration tests, covering password accounts and account deletion

### Version 4.15.0

- **Self-Hosting**: Improve Admin dashboard for Self-Hosted, allowing the admin to add and delete users
Expand Down
22 changes: 11 additions & 11 deletions backend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@retrospected/backend",
"version": "4.15.1",
"version": "4.16.0",
"license": "GNU GPLv3",
"private": true,
"scripts": {
Expand Down Expand Up @@ -29,8 +29,8 @@
"@types/express-rate-limit": "6.0.0",
"@types/express-session": "1.17.4",
"@types/jest": "27.4.1",
"@types/lodash": "4.14.181",
"@types/node": "17.0.23",
"@types/lodash": "4.14.182",
"@types/node": "17.0.25",
"@types/node-fetch": "2.5.12",
"@types/nodemailer": "6.4.4",
"@types/passport": "1.0.7",
Expand All @@ -42,36 +42,36 @@
"@types/shortid": "0.0.29",
"@types/socket.io-redis": "3.0.0",
"@types/uuid": "8.3.4",
"@typescript-eslint/eslint-plugin": "5.18.0",
"@typescript-eslint/parser": "5.18.0",
"@typescript-eslint/eslint-plugin": "5.20.0",
"@typescript-eslint/parser": "5.20.0",
"bcryptjs": "2.4.3",
"chalk": "4.1.2",
"connect-redis": "6.1.3",
"copyfiles": "2.4.1",
"crypto-js": "4.1.1",
"date-fns": "2.28.0",
"dotenv": "16.0.0",
"eslint": "8.13.0",
"eslint": "8.14.0",
"eslint-config-prettier": "8.5.0",
"eslint-plugin-prettier": "4.0.0",
"express": "4.17.3",
"express-mung": "0.5.1",
"express-rate-limit": "6.3.0",
"express-rate-limit": "6.4.0",
"express-session": "1.17.2",
"freemail": "1.7.0",
"handlebars": "4.7.7",
"jest": "27.5.1",
"lexorank": "1.0.4",
"lodash": "4.17.21",
"moment": "2.29.2",
"moment": "2.29.3",
"node-fetch": "2.6.7",
"nodemailer": "6.7.3",
"nodemon": "2.0.15",
"passport": "0.5.0",
"passport-github2": "0.1.12",
"passport-google-oauth20": "2.0.0",
"passport-local": "1.0.0",
"passport-microsoft": "0.1.0",
"passport-microsoft": "1.0.0",
"passport-okta-oauth20": "1.1.0",
"passport-slack": "0.0.7",
"passport-twitter": "1.0.4",
Expand All @@ -81,9 +81,9 @@
"redis": "3.1.2",
"rimraf": "3.0.2",
"shortid": "2.2.16",
"socket.io": "4.4.1",
"socket.io": "4.5.0",
"socket.io-redis": "6.1.1",
"stripe": "8.216.0",
"stripe": "8.219.0",
"ts-jest": "27.1.4",
"ts-node": "10.7.0",
"typeorm": "0.2.45",
Expand Down
4 changes: 4 additions & 0 deletions backend/src/auth/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ const oktaAuth = passport.authenticate('okta');

function anonAuth(req: Request, res: Response, next: NextFunction) {
passport.authenticate('local', function (err, user) {
res.setHeader('Content-Type', 'application/json');

if (err) {
return res.status(403).send().end();
}
Expand All @@ -31,6 +33,8 @@ function anonAuth(req: Request, res: Response, next: NextFunction) {
}

export const endOAuthHandler = (req: Request, res: Response) => {
res.setHeader('Content-Type', 'application/json');

const io = req.app.get('io');
io.in(req.session!.socketId).emit('auth', req.user);
req.logIn(req.user!, (err: unknown) => {
Expand Down
Loading

0 comments on commit 97464e5

Please sign in to comment.