-
Notifications
You must be signed in to change notification settings - Fork 8
User Registration(Closes #55) #60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
nodatall
left a comment
There was a problem hiding this 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 } | ||
| }, | ||
| { |
There was a problem hiding this comment.
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
a70a7ad to
f27203c
Compare
jrobcodes
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/authentication/register.js
Outdated
| } | ||
|
|
||
| return response.status( 201 ).json( tokenInfo( user )) | ||
| response.redirect('http://localhost:3000/dashboard') |
There was a problem hiding this comment.
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 ) { /* ... */ }
src/authentication/register.js
Outdated
| exports.register = ( request, response, next ) => { | ||
| const { email, password } = request.body | ||
| const { name, email, password, phone_number, newsletter_subscribed, company } | ||
| = request.body |
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
f27203c to
0aefb04
Compare
jrobcodes
left a comment
There was a problem hiding this 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
src/authentication/register.js
Outdated
| } | ||
|
|
||
| return response.status( 201 ).json( tokenInfo( user )) | ||
| response.redirect( 'http://localhost:3000/dashboard' ) |
There was a problem hiding this comment.
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.
0aefb04 to
be2bf9d
Compare
tested authentication to make sure users post correctly to the database with required information. updated user schema to reflect that information