Skip to content

Commit

Permalink
Merge pull request #224 from mcagov/remove-logging
Browse files Browse the repository at this point in the history
Remove logging
  • Loading branch information
bnjn-mt authored Sep 17, 2024
2 parents 46e33cd + d746618 commit 454379d
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 27 deletions.
2 changes: 0 additions & 2 deletions webapp/api/routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import accountError from './portal/error';

import sendSample from './report/send-sample';
import health from './health';
import printEnv from './printEnv';


export default () => {
Expand Down Expand Up @@ -63,7 +62,6 @@ export default () => {
accountError(app);

sendSample(app);
printEnv(app);

health(app);
return app;
Expand Down
7 changes: 2 additions & 5 deletions webapp/api/routes/portal/error.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
export default function (app) {

app.get('/error', function (req, res) {
const error = req.session.errorMessage || 'An error occurred';
delete req.session.errorMessage;

req.session.destroy(function (err) {
req.logOut();

console.log(error);
console.log('An Azure auth service error occurred');
return res.redirect(`${process.env.B2C_BASE_URL}/oauth2/v2.0/logout?p=B2C_1_login&post_logout_redirect_uri=${process.env.ENV_BASE_URL}/service-error`);
});
});

app.get('/account-error', function (req, res) {
req.session.destroy(function (err) {
console.dir(err);
console.log('An Azure auth account error occurred');
req.logOut();
return res.redirect(`${process.env.B2C_BASE_URL}/oauth2/v2.0/logout?p=B2C_1_login&post_logout_redirect_uri=${process.env.ENV_BASE_URL}/account-notification`);
});
Expand Down
4 changes: 2 additions & 2 deletions webapp/api/routes/portal/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default function (app) {
var findByOid = function (oid, fn) {
for (var i = 0, len = users.length; i < len; i++) {
var user = users[i];
log.info('we are using user: ', user);
log.info('User logged in.');
if (user.oid === oid) {
return fn(null, user);
}
Expand All @@ -51,7 +51,7 @@ export default function (app) {
useCookieInsteadOfSession: false,
cookieSameSite: false,
loggingLevel: 'info',
loggingNoPII: false,
loggingNoPII: true,
scope: process.env.B2C_CLIENT_ID,
},
function (iss, sub, profile, accessToken, refreshToken, params, done) {
Expand Down
2 changes: 0 additions & 2 deletions webapp/api/routes/portal/loginRedirectUrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ export default function (app) {
failureRedirect: '/error',
})(req, res, function (err) {
if (err) {
// Save the error message in the session
req.session.errorMessage = err.message;
// Redirect to the error page
return res.redirect('/error');
}
Expand Down
8 changes: 0 additions & 8 deletions webapp/api/routes/printEnv.js

This file was deleted.

8 changes: 0 additions & 8 deletions webapp/app/views/print-env.html

This file was deleted.

0 comments on commit 454379d

Please sign in to comment.