Fix #48: Proper 404 and 403 pages when trying to open non-existant chatroom (WIP).
This commit is contained in:
@ -18,9 +18,17 @@ async function initConfigurationApiRouter (options: RegisterServerOptions, route
|
||||
router.get('/configuration/room/:roomKey', asyncMiddleware(
|
||||
async (req: Request, res: Response, _next: NextFunction): Promise<void> => {
|
||||
const roomKey = req.params.roomKey
|
||||
const initConverseJSParam = await getConverseJSParams(options, roomKey, {
|
||||
forcetype: req.query.forcetype === '1'
|
||||
})
|
||||
|
||||
const user = await options.peertubeHelpers.user.getAuthUser(res)
|
||||
|
||||
const initConverseJSParam = await getConverseJSParams(
|
||||
options,
|
||||
roomKey,
|
||||
{
|
||||
forcetype: req.query.forcetype === '1'
|
||||
},
|
||||
!!user
|
||||
)
|
||||
if (('isError' in initConverseJSParam) && initConverseJSParam.isError) {
|
||||
res.sendStatus(initConverseJSParam.code)
|
||||
return
|
||||
|
Reference in New Issue
Block a user