Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

Commit

Permalink
merge dev to main (#287)
Browse files Browse the repository at this point in the history
* Update general_oauth_routes.ts

* Update server.ts

* Update general_oauth_routes.ts

* debug logs

* Update google_oauth20_manager.ts
  • Loading branch information
TheJeterLP authored Mar 27, 2024
1 parent 460635d commit 9e48062
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export function register_general_oauth_routes(app: Application) {
if (err) {
res.status(500).send();
} else {
debug('session destroyed!');
res.status(200).send();
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@ import jwt from 'jsonwebtoken';

import { User } from '../../models/user.model';
import { server_settings, security_settings } from '../../../json/config.json';
import { debug } from '../../tools/logmanager';

export function register_google_oauth_20_routes(app: Application) {
// Either sign-in or sign-up and then sign-in
app.post('/auth/google', async (req, res) => {
const credential = req.body.credential;
const tokenFromBody = req.body.g_csrf_token;
const cookie = req.cookies['g_csrf_token'];

if ((credential === undefined || tokenFromBody === undefined || cookie === undefined) || (tokenFromBody != cookie)) {
debug('credential: ' + credential);

if (credential === undefined) {
return res.redirect(server_settings.frontend_url + '/auth/failed');
}

Expand Down

0 comments on commit 9e48062

Please sign in to comment.