fix(auth): Fix auth flow for the client app
This commit is contained in:
committed by
mrugesh mohapatra
parent
a656cbf98a
commit
c08bb95ea8
@ -1,15 +1,16 @@
|
||||
import accepts from 'accepts';
|
||||
|
||||
import { homeLocation } from '../../../config/env.json';
|
||||
|
||||
export default function fourOhFour(app) {
|
||||
app.all('*', function(req, res) {
|
||||
const accept = accepts(req);
|
||||
const type = accept.type('html', 'json', 'text');
|
||||
const { path } = req;
|
||||
|
||||
|
||||
if (type === 'html') {
|
||||
req.flash('danger', `We couldn't find path ${ path }`);
|
||||
return res.render('404', { title: '404'});
|
||||
req.flash('danger', `We couldn't find path ${path}`);
|
||||
return res.redirectWithFlash(`${homeLocation}/404`);
|
||||
}
|
||||
|
||||
if (type === 'json') {
|
||||
|
Reference in New Issue
Block a user