Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update NodeJS backend dependencies. #214

Merged
merged 45 commits into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
648e6d4
feat: update dependencies, switch to esm modules
trev-dev Jun 10, 2024
a15d768
fix: "async" function messing up login flow
trev-dev Jun 17, 2024
a1e01e4
fix: breaking changes in nats
trev-dev Jun 17, 2024
91f7119
feat: update Redis, align with NATS
trev-dev Jun 17, 2024
972fde8
fix: breaking changes to passport logout flow
trev-dev Jun 17, 2024
85f7e3e
fix: not an async function
trev-dev Jun 17, 2024
c98a153
fix: session destruction breaking login flow
trev-dev Jun 17, 2024
230013e
chore: clean up logout function
trev-dev Jun 17, 2024
4587306
fix: breaking change, passport.use is async
trev-dev Jun 17, 2024
dd6f538
fix: dropped `auth` namespace
trev-dev Jun 17, 2024
84d338a
fix: remove no longer needed @babel deps
trev-dev Jun 17, 2024
65f119f
chore: whitespace
trev-dev Jun 17, 2024
15a12af
fix: breaking changes for eslint
trev-dev Jun 18, 2024
16e96b8
fix: linting errors
trev-dev Jun 18, 2024
8b5773d
update: dependencies
trev-dev Aug 15, 2024
7685c03
fix: tests
trev-dev Aug 20, 2024
2819eab
feat: add debug command
trev-dev Aug 28, 2024
89b32bb
fix: bad reference
trev-dev Aug 29, 2024
4d46bd4
fix: eslint issues
trev-dev Aug 29, 2024
352d54b
feat: add express rate-limiting environment vars
trev-dev Sep 3, 2024
f4708cd
fix: wrap interpolated constants in quotes
trev-dev Sep 3, 2024
e14a424
fix: npm script keys
trev-dev Sep 3, 2024
17a9377
feat: implement rate limiting
trev-dev Sep 3, 2024
b490b17
fix: smell - function complexity
trev-dev Sep 3, 2024
b679675
fix: smell - use chained operators and avoid nested ternaries
trev-dev Sep 3, 2024
05400e5
fix: smell - double import
trev-dev Sep 3, 2024
cf759be
fix: insane defaults for chained methods
trev-dev Sep 3, 2024
bd89219
Merge branch 'master' into fix/HD-26946
trev-dev Sep 3, 2024
611ca49
feat: add sonar reporter for vitest
trev-dev Sep 3, 2024
fa42dd1
Merge branch 'master' into fix/HD-26946
trev-dev Sep 18, 2024
bccd932
fix: update dependencies
trev-dev Sep 18, 2024
9095d9e
fix: codeQL multiple imports
trev-dev Oct 24, 2024
932b42b
Merge branch 'master' into fix/HD-26946
trev-dev Nov 25, 2024
0ef33bb
feat: add url param validations
trev-dev Nov 25, 2024
1de22cc
feat: update dependencies
trev-dev Nov 25, 2024
1b62aff
codeql: validate UUIDs within function scope
trev-dev Nov 26, 2024
c774035
fix: deleteDocument tests
trev-dev Nov 26, 2024
c5223fc
Merge branch 'master' into fix/HD-26946
trev-dev Nov 27, 2024
3e9a53e
fix: codeql suggestions and fix tests
trev-dev Nov 27, 2024
ae8673e
fix: downloadFileHander user data validator & test
trev-dev Nov 27, 2024
a94bf86
fix: add user validations to uploadFile and tests
trev-dev Nov 27, 2024
a0aa138
fix: remove redundant in-function validators
trev-dev Nov 27, 2024
1243ef5
feat: remove weird requirement for document name
trev-dev Nov 27, 2024
22f6c1e
fix: logout flow
trev-dev Nov 27, 2024
fbfe82b
fix: console logs
trev-dev Nov 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion backend/src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ async function addLoginPassportUse(discovery, strategyName, callbackURI, kc_idp_
callbackURL: callbackURI,
scope: discovery.scopes_supported,
kc_idp_hint: kc_idp_hint
}, (_issuer, profile, _context, _idToken, accessToken, refreshToken, done) => {
}, (_issuer, profile, _context, idToken, accessToken, refreshToken, done) => {
if ((typeof (accessToken) === 'undefined') || (accessToken === null) ||
(typeof (refreshToken) === 'undefined') || (refreshToken === null)) {
return done('No access token', null);
Expand All @@ -110,6 +110,7 @@ async function addLoginPassportUse(discovery, strategyName, callbackURI, kc_idp_
profile.jwtFrontend = auth.generateUiToken();
profile.jwt = accessToken;
profile.refreshToken = refreshToken;
profile.idToken = idToken;
profile._json = parseJwt(accessToken);
return done(null, profile);
}));
Expand Down
18 changes: 12 additions & 6 deletions backend/src/routes/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,17 @@ addBaseRouterGet('oidcBceidUMP', '/login_bceid_ump');

//removes tokens and destroys session
router.get('/logout', async (req, res, next) => {
const makeUrl = endpoint => encodeURIComponent(
config.get('logoutEndpoint')
+ `?post_logout_redirect_uri=${config.get('server:frontend')}`
+ endpoint
+ `&client_id=${config.get('oidc:clientId')}`
);
let idToken = req?.session?.passport?.user?.idToken;

const makeUrl = endpoint => {
console.log(req.user);
arcshiftsolutions marked this conversation as resolved.
Show resolved Hide resolved
return encodeURIComponent(
config.get('logoutEndpoint')
+ `?post_logout_redirect_uri=${config.get('server:frontend')}`
+ endpoint
+ (idToken ? `&id_token_hint=${idToken}` : `&client_id=${config.get('oidc:clientId')}`)
);
};

let retUrl;
req.logout(err => {
Expand All @@ -94,6 +99,7 @@ router.get('/logout', async (req, res, next) => {
} else {
retUrl = makeUrl('/logout');
}
console.log('RET ::: ', retUrl);
arcshiftsolutions marked this conversation as resolved.
Show resolved Hide resolved
res.redirect(config.get('siteMinder_logout_endpoint') + retUrl);
});
});
Expand Down
Loading