@ministryofjustice/hmpps-digital-prison-reporting-frontend
Version:
The Digital Prison Reporting Frontend contains templates and code to help display data effectively in UI applications.
10 lines (8 loc) • 330 B
text/typescript
import { NextFunction, Request, Response } from 'express'
export default (request: Request, response: Response, next: NextFunction): string => {
if (response.locals.user && response.locals.user.token) {
return response.locals.user.token
}
next('Could not find user token in response.locals.user.token')
return null
}