Skip to content

Commit 68cec0c

Browse files
committed
reprotect routes - implement initial keycloak oauth implementation
1 parent b5ec51e commit 68cec0c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/utils/auth.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ const JWT_SECRET = process.env.JWT_SECRET
99

1010
// all of this may change due to keycloak oauth support
1111
export function logIncomingAuth(req: Request, res: Response, next: NextFunction) {
12-
logger.info(`[AUTH] Connection from ${req.headers['cf-connecting-ip'] ?? req.ip} - ${req.headers['cf-ipcountry'] ?? 'unknown country'}`)
12+
logger.info(
13+
`[AUTH] Connection from ${req.headers['cf-connecting-ip'] ?? req.ip} - ${req.headers['cf-ipcountry'] ?? 'unknown country'}`
14+
)
1315

1416
// For "manual" JWT
1517
const authHeader = req.headers.authorization
@@ -34,6 +36,7 @@ export function logIncomingAuth(req: Request, res: Response, next: NextFunction)
3436
next()
3537
}
3638

39+
// Deprecated exports, or present to support basic JWT authentication w/ shared secret
3740
export const authRequired = expressjwt({
3841
secret: JWT_SECRET!,
3942
issuer: 'https://auth.subtype.space',

0 commit comments

Comments
 (0)