set up error page

This commit is contained in:
Víctor Losada Hernández committed 2024-08-28 21:10:28 +02:00
1 parent c9947d7f91
commit 6436e62ec0
2 files changed
+20 -1

No files matched your search

+9 -1
View File
@@ -358,10 +358,18 @@ app.get('/share/:id', asyncHandler(getBrew('share')), asyncHandler(async (req, r
//Account Page
app.get('/account', asyncHandler(async (req, res, next)=>{
if(!req.account) return res.redirect('/');
const data = {};
data.title = 'Account Information Page';
if(!req.account) {
res.set('WWW-Authenticate', 'Bearer realm="Authorization Required"');
const error = new Error('No valid account');
error.status = 401;
error.HBErrorCode = '50';
error.page = data.title;
return next(error);
};
let auth;
let googleCount = [];
if(req.account) {