added verbose logging
This commit is contained in:
parent
97e8e4cf7a
commit
26900abaa6
3 changed files with 11 additions and 10 deletions
|
@ -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
|
passReqToCallback: true, // we want to be able to read the post body message parameters in the callback
|
||||||
},
|
},
|
||||||
(req, username, password, done) => {
|
(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 = {};
|
let userInfo = {};
|
||||||
// server-side validaton of inputs (username, password)
|
// server-side validaton of inputs (username, password)
|
||||||
|
|
||||||
|
@ -23,37 +23,37 @@ module.exports = new PassportLocalStrategy(
|
||||||
userName: username,
|
userName: username,
|
||||||
password: password,
|
password: password,
|
||||||
};
|
};
|
||||||
logger.debug('userData >', userData);
|
logger.verbose('userData >', userData);
|
||||||
// create user record
|
// create user record
|
||||||
const channelData = {
|
const channelData = {
|
||||||
channelName : `@${username}`,
|
channelName : `@${username}`,
|
||||||
channelClaimId: tx.claim_id,
|
channelClaimId: tx.claim_id,
|
||||||
};
|
};
|
||||||
logger.debug('channelData >', channelData);
|
logger.verbose('channelData >', channelData);
|
||||||
// create certificate record
|
// create certificate record
|
||||||
const certificateData = {
|
const certificateData = {
|
||||||
claimId: tx.claim_id,
|
claimId: tx.claim_id,
|
||||||
name : `@${username}`,
|
name : `@${username}`,
|
||||||
// address,
|
// address,
|
||||||
};
|
};
|
||||||
logger.debug('certificateData >', certificateData);
|
logger.verbose('certificateData >', certificateData);
|
||||||
// save user and certificate to db
|
// save user and certificate to db
|
||||||
return Promise.all([db.User.create(userData), db.Channel.create(channelData), db.Certificate.create(certificateData)]);
|
return Promise.all([db.User.create(userData), db.Channel.create(channelData), db.Certificate.create(certificateData)]);
|
||||||
})
|
})
|
||||||
.then(([newUser, newChannel, newCertificate]) => {
|
.then(([newUser, newChannel, newCertificate]) => {
|
||||||
logger.debug('user and certificate successfully created');
|
logger.verbose('user and certificate successfully created');
|
||||||
logger.debug('user result >', newUser.dataValues);
|
logger.debug('user result >', newUser.dataValues);
|
||||||
userInfo['id'] = newUser.id;
|
userInfo['id'] = newUser.id;
|
||||||
userInfo['userName'] = newUser.userName;
|
userInfo['userName'] = newUser.userName;
|
||||||
logger.debug('channel result >', newChannel.dataValues);
|
logger.verbose('channel result >', newChannel.dataValues);
|
||||||
userInfo['channelName'] = newChannel.channelName;
|
userInfo['channelName'] = newChannel.channelName;
|
||||||
userInfo['channelClaimId'] = newChannel.channelClaimId;
|
userInfo['channelClaimId'] = newChannel.channelClaimId;
|
||||||
logger.debug('certificate result >', newCertificate.dataValues);
|
logger.verbose('certificate result >', newCertificate.dataValues);
|
||||||
// associate the instances
|
// associate the instances
|
||||||
return Promise.all([newCertificate.setChannel(newChannel), newChannel.setUser(newUser)]);
|
return Promise.all([newCertificate.setChannel(newChannel), newChannel.setUser(newUser)]);
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
logger.debug('user and certificate successfully associated');
|
logger.verbose('user and certificate successfully associated');
|
||||||
return db.getShortChannelIdFromLongChannelId(userInfo.channelClaimId, userInfo.channelName);
|
return db.getShortChannelIdFromLongChannelId(userInfo.channelClaimId, userInfo.channelName);
|
||||||
})
|
})
|
||||||
.then(shortChannelId => {
|
.then(shortChannelId => {
|
||||||
|
|
|
@ -417,7 +417,7 @@ table {
|
||||||
}
|
}
|
||||||
|
|
||||||
.nav-bar-logo, .nav-bar-title, .nav-bar-link, .nav-bar-subtitle {
|
.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;
|
display: inline-block;
|
||||||
color: black;
|
color: black;
|
||||||
}
|
}
|
||||||
|
@ -464,6 +464,7 @@ table {
|
||||||
.dropzone:hover, .dropzone--drag-over {
|
.dropzone:hover, .dropzone--drag-over {
|
||||||
border: 2px dashed dodgerblue;
|
border: 2px dashed dodgerblue;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
background-color: #FCFCFC;
|
||||||
}
|
}
|
||||||
|
|
||||||
#primary-dropzone-wrapper, #publish-form-wrapper {
|
#primary-dropzone-wrapper, #publish-form-wrapper {
|
||||||
|
|
|
@ -4,7 +4,7 @@ const passport = require('passport');
|
||||||
module.exports = (app) => {
|
module.exports = (app) => {
|
||||||
// route for sign up
|
// route for sign up
|
||||||
app.post('/signup', passport.authenticate('local-signup'), (req, res) => {
|
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({
|
res.status(200).json({
|
||||||
success : true,
|
success : true,
|
||||||
channelName : req.user.channelName,
|
channelName : req.user.channelName,
|
||||||
|
|
Loading…
Reference in a new issue