mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2025-12-24 16:22:44 +00:00
remove unnecessary, cluttering logs
This commit is contained in:
@@ -91,7 +91,6 @@ app.use(cors(corsOptions));
|
|||||||
|
|
||||||
//Account Middleware
|
//Account Middleware
|
||||||
app.use((req, res, next)=>{
|
app.use((req, res, next)=>{
|
||||||
console.log('passing through acc middleware, checking for cookies now: does cookies exist? ', !!req.cookies, ', ok, does the session cookie exist? ', !!req.cookies.nc_session);
|
|
||||||
if(req.cookies && req.cookies.nc_session){
|
if(req.cookies && req.cookies.nc_session){
|
||||||
try {
|
try {
|
||||||
req.account = jwt.decode(req.cookies.nc_session, config.get('secret'));
|
req.account = jwt.decode(req.cookies.nc_session, config.get('secret'));
|
||||||
@@ -352,12 +351,8 @@ app.get('/user/:username', async (req, res, next)=>{
|
|||||||
//Change author name on brews
|
//Change author name on brews
|
||||||
app.put('/api/user/rename', async (req, res)=>{
|
app.put('/api/user/rename', async (req, res)=>{
|
||||||
const { username, newUsername } = req.body;
|
const { username, newUsername } = req.body;
|
||||||
|
console.log(req.account);
|
||||||
//this next logs will be removed in a next PR, as i need to get this live to test if req.account is created when passing the request from naturalcrit.com
|
|
||||||
|
|
||||||
console.log(`is user ${req.account.username} equal to ${username}? ${req.account.username === username} ${req.account.username === username && 'then add the damn auth for renaming!'}`);
|
|
||||||
console.log('renaming');
|
|
||||||
|
|
||||||
if(!username || !newUsername) {
|
if(!username || !newUsername) {
|
||||||
return res.status(400).json({ error: 'Username and newUsername are required.' });
|
return res.status(400).json({ error: 'Username and newUsername are required.' });
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user