Skip to content

Commit f6f0fc8

Browse files
committed
Updated node and deps (except got)
1 parent 1ccff69 commit f6f0fc8

File tree

5 files changed

+4414
-9355
lines changed

5 files changed

+4414
-9355
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ config/auth.secret
1010

1111
.tmp/
1212
export-*
13+
.tap

main.mjs

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import http from 'http';
33
import https from 'https';
44
import { readFileSync } from 'fs';
55
import express from 'express';
6-
import jwt from 'express-jwt';
6+
import { expressjwt as jwt } from 'express-jwt';
77
import cors from 'cors';
88
import * as db from './db.mjs';
99
import { pick, sleep, git_sha, svg_width } from './util.mjs';
@@ -66,14 +66,14 @@ function require_sub(...subs) {
6666
// pass if auth is disabled or no subjects are required
6767
if (CONFIG.auth.enabled === false || subs.length == 0) { next(); return; }
6868
// check if token subject is one of the required subjects
69-
// console.log('got sub:', req.user.sub);
70-
if ( !subs.includes(req.user.sub) ) {
69+
// console.log('got sub:', req.auth.sub);
70+
if ( !subs.includes(req.auth.sub) ) {
7171
res.status(403).json({'error': 'wrong subject'});
7272
return;
7373
}
7474
// check if subject isn't expired (issued at or after latest issue date for the role)
7575
// doesn't apply if no issued_at is defined for a subject
76-
if ( req.user.iat < CONFIG.auth.subject_issued_at[req.user.sub] ) {
76+
if ( req.auth.iat < CONFIG.auth.subject_issued_at[req.auth.sub] ) {
7777
res.status(403).json({'error': 'subject expired'});
7878
return;
7979
}

0 commit comments

Comments
 (0)