Skip to content

Conversation

@Moniarchy
Copy link
Contributor

tested authentication to make sure users post correctly to the database with required information. updated user schema to reflect that information

Copy link
Contributor

@nodatall nodatall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks goood!

models/users.js Outdated
dragonboard_bar: { type: Boolean, default: true },
active: { type: Boolean, default: true }
},
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put 17-20 on one line

@Moniarchy Moniarchy force-pushed the 55-user-registration branch from a70a7ad to f27203c Compare December 17, 2016 01:38
Copy link
Contributor

@jrobcodes jrobcodes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}

return response.status( 201 ).json( tokenInfo( user ))
response.redirect('http://localhost:3000/dashboard')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add spaces between opening and closing parentheses, and arguments, in a function invocation or control flow expression:

fn(param1, param2) { /* ... */ }
if(expression) { /* ... */ }

should be

fn( params1, param2 ) { /* ... */ }
if( expression ) { /* ... */ }

exports.register = ( request, response, next ) => {
const { email, password } = request.body
const { name, email, password, phone_number, newsletter_subscribed, company }
= request.body
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not like this formatting. I would prefer instead:

const { 
  name, email, password, phone_number, newsletter_subscribed, company 
} = request.body

"passport-jwt": "^2.2.1",
"passport-local": "^1.0.0",
"pug": "^2.0.0-beta6",
"rand-token": "^0.3.0",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you tell me about the need for adding this dependency?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we used it in the UserSchema to generate a random API key for users when a new one is created.

@nodatall nodatall force-pushed the 55-user-registration branch from f27203c to 0aefb04 Compare December 19, 2016 22:51
Copy link
Contributor

@jrobcodes jrobcodes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nodatall one fix needed

}

return response.status( 201 ).json( tokenInfo( user ))
response.redirect( 'http://localhost:3000/dashboard' )
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should not be hard coding the base URL.

@nodatall nodatall force-pushed the 55-user-registration branch from 0aefb04 to be2bf9d Compare December 22, 2016 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants