From bd0a2b5c41c35642447780c0b5ffd44cb2556432 Mon Sep 17 00:00:00 2001 From: SevenWaysDP Date: Tue, 24 Sep 2024 14:49:43 +0200 Subject: [PATCH] BC-8018 - refactor API endpoint for retrieving JWT in users controller --- controllers/users.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/controllers/users.js b/controllers/users.js index 24cab6b..c81def3 100644 --- a/controllers/users.js +++ b/controllers/users.js @@ -438,7 +438,7 @@ router.get('/search', function (req, res, next) { router.get('/jwt/:id', async (req, res, next) => { try { - const getJWT = api(req).post('/accounts/supportJWT', { + const getJWT = api(req, {version: 'v3'}).post('/shd/supportJwt', { json: { userId: req.params.id, }, @@ -449,7 +449,7 @@ router.get('/jwt/:id', async (req, res, next) => { res.render('users/jwt', { title: `JWT für ${user.displayName}`, - jwt: jwt || '', + jwt: jwt.accessToken || '', user: user, themeTitle: process.env.SC_NAV_TITLE || 'Schul-Cloud', });