Skip to content

Commit

Permalink
Fix lesson access
Browse files Browse the repository at this point in the history
  • Loading branch information
roman-nebel committed Nov 28, 2023
1 parent 7721a46 commit 869b1e9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/utils/checkAuth.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,11 @@ function checkModuleAccess(req, res, next) {
function checkCertAccess(req, res, next) {
const userId = req.userId;

const moduleId = req?.query?.moduleId || req?.body?.moduleId;
const lessonId = req?.query?.lessonId || req?.body?.lessonId;
const moduleId = req?.query?.moduleId ||
req?.body?.moduleId ||
getModuleId(lessonId);;


db.USERS.findOne({ id: userId }).then((user) => {
const modules = Object.keys(user?.modules || {});
Expand Down

0 comments on commit 869b1e9

Please sign in to comment.