mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2026-04-28 11:17:38 +02:00
fixed content type check, added bit more logging on getnewdata since ep
This commit is contained in:
@@ -53,13 +53,15 @@ export const testUser: User = {
|
||||
|
||||
function renderLogin(req: Request, res: Response) {
|
||||
res.status(401) // Unauthorized
|
||||
if (req.is('application/json')) {
|
||||
if (req.headers['content-type'] === 'application/json') {
|
||||
res.json({
|
||||
result: 'nouser',
|
||||
msg: 'You are not logged in',
|
||||
})
|
||||
return
|
||||
} else {
|
||||
res.render('login')
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user