mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-05 21:02:43 +00:00
Move check for account up a little
This commit is contained in:
@@ -358,17 +358,17 @@ app.get('/share/:id', asyncHandler(getBrew('share')), asyncHandler(async (req, r
|
|||||||
|
|
||||||
//Account Page
|
//Account Page
|
||||||
app.get('/account', asyncHandler(async (req, res, next)=>{
|
app.get('/account', asyncHandler(async (req, res, next)=>{
|
||||||
const data = {};
|
|
||||||
data.title = 'Account Information Page';
|
|
||||||
|
|
||||||
if(!req.account) {
|
if(!req.account) {
|
||||||
res.set('WWW-Authenticate', 'Bearer realm="Authorization Required"');
|
res.set('WWW-Authenticate', 'Bearer realm="Authorization Required"');
|
||||||
const error = new Error('No valid account');
|
const error = new Error('No valid account');
|
||||||
error.status = 401;
|
error.status = 401;
|
||||||
error.HBErrorCode = '50';
|
error.HBErrorCode = '50';
|
||||||
error.page = data.title;
|
error.page = data.title;
|
||||||
return next(error);
|
return next(error);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const data = {};
|
||||||
|
data.title = 'Account Information Page';
|
||||||
|
|
||||||
let auth;
|
let auth;
|
||||||
let googleCount = [];
|
let googleCount = [];
|
||||||
|
|||||||
Reference in New Issue
Block a user