added verbose logging

This commit is contained in:
bill bittner 2017-10-17 12:05:22 -07:00
parent 97e8e4cf7a
commit 26900abaa6
3 changed files with 11 additions and 10 deletions

View file

@ -11,7 +11,7 @@ module.exports = new PassportLocalStrategy(
passReqToCallback: true, // we want to be able to read the post body message parameters in the callback
},
(req, username, password, done) => {
logger.debug(`new channel signup request. user: ${username} pass: ${password} .`);
logger.verbose(`new channel signup request. user: ${username} pass: ${password} .`);
let userInfo = {};
// server-side validaton of inputs (username, password)
@ -23,37 +23,37 @@ module.exports = new PassportLocalStrategy(
userName: username,
password: password,
};
logger.debug('userData >', userData);
logger.verbose('userData >', userData);
// create user record
const channelData = {
channelName : `@${username}`,
channelClaimId: tx.claim_id,
};
logger.debug('channelData >', channelData);
logger.verbose('channelData >', channelData);
// create certificate record
const certificateData = {
claimId: tx.claim_id,
name : `@${username}`,
// address,
};
logger.debug('certificateData >', certificateData);
logger.verbose('certificateData >', certificateData);
// save user and certificate to db
return Promise.all([db.User.create(userData), db.Channel.create(channelData), db.Certificate.create(certificateData)]);
})
.then(([newUser, newChannel, newCertificate]) => {
logger.debug('user and certificate successfully created');
logger.verbose('user and certificate successfully created');
logger.debug('user result >', newUser.dataValues);
userInfo['id'] = newUser.id;
userInfo['userName'] = newUser.userName;
logger.debug('channel result >', newChannel.dataValues);
logger.verbose('channel result >', newChannel.dataValues);
userInfo['channelName'] = newChannel.channelName;
userInfo['channelClaimId'] = newChannel.channelClaimId;
logger.debug('certificate result >', newCertificate.dataValues);
logger.verbose('certificate result >', newCertificate.dataValues);
// associate the instances
return Promise.all([newCertificate.setChannel(newChannel), newChannel.setUser(newUser)]);
})
.then(() => {
logger.debug('user and certificate successfully associated');
logger.verbose('user and certificate successfully associated');
return db.getShortChannelIdFromLongChannelId(userInfo.channelClaimId, userInfo.channelName);
})
.then(shortChannelId => {

View file

@ -417,7 +417,7 @@ table {
}
.nav-bar-logo, .nav-bar-title, .nav-bar-link, .nav-bar-subtitle {
padding: 2rem 0.5rem 1.5rem 0.5rem;
padding: 2rem 1rem 1.5rem 1rem;
display: inline-block;
color: black;
}
@ -464,6 +464,7 @@ table {
.dropzone:hover, .dropzone--drag-over {
border: 2px dashed dodgerblue;
cursor: pointer;
background-color: #FCFCFC;
}
#primary-dropzone-wrapper, #publish-form-wrapper {

View file

@ -4,7 +4,7 @@ const passport = require('passport');
module.exports = (app) => {
// route for sign up
app.post('/signup', passport.authenticate('local-signup'), (req, res) => {
logger.debug('successful signup');
logger.verbose(`successful signup for ${req.user.channelName}`);
res.status(200).json({
success : true,
channelName : req.user.channelName,