-
Notifications
You must be signed in to change notification settings - Fork 23
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
Feature/google signin #50
Conversation
import userController from '../controllers/users'; | ||
import bookController from '../controllers/books'; | ||
import userController from '../controllers/userController'; | ||
import bookController from '../controllers/bookController'; |
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.
Unable to resolve path to module '../controllers/bookController' import/no-unresolved
@@ -1,8 +1,8 @@ | |||
import express from 'express'; | |||
|
|||
|
|||
import userController from '../controllers/users'; | |||
import bookController from '../controllers/books'; | |||
import userController from '../controllers/userController'; |
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.
Unable to resolve path to module '../controllers/userController' import/no-unresolved
server/controllers/userController.js
Outdated
error, | ||
})); | ||
})}); |
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.
Expected indentation of 6 spaces but found 4 indent
Requires a space before '}' block-spacing
Missing semicolon semi
Closing curly brace should be on the same line as opening curly brace or on the line after the previous block brace-style
server/controllers/userController.js
Outdated
@@ -154,9 +157,11 @@ export default { | |||
}).catch(error => res.status(500).send({ | |||
error, | |||
})); | |||
}).catch(error => res.status(400).send({ | |||
}).catch((error) => { | |||
console.log('======== ERROR HERE ======\n', error); |
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.
Unexpected console statement no-console
client/components/auth/SignUp.jsx
Outdated
const username = email.slice(0, email.indexOf('@')); | ||
const firstName = googleProfile.getGivenName(); | ||
const lastName = googleProfile.getFamilyName(); | ||
console.log(username, firstName, lastName, email); |
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.
Unexpected console statement no-console
client/components/auth/SignUp.jsx
Outdated
responseGoogle(response) { | ||
const googleProfile = response.getBasicProfile(); | ||
const email = googleProfile.getEmail(); | ||
const id = googleProfile.getId(); |
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.
'id' is assigned a value but never used no-unused-vars
3acba1b
to
6a8153c
Compare
return res.status(200).send({ | ||
message: 'An password reset link has been sent to your email', | ||
}); | ||
}); |
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.
Expected a newline before ')' function-paren-newline
const html = `<h3>Use this link to reset your password.</h3> | ||
${BASE_URL}/reset-password?token=${token}} | ||
<p>This link is valid only for an hour</p>`; | ||
transporter.sendMail(mailOptions(to, bcc, subject, html), |
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.
Expected a newline after '(' function-paren-newline
} else if (req.query && req.query.returned === 'true') { | ||
books = user.Books.filter( | ||
book => book.BorrowedBook.returned === 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.
Unexpected newline before ')' function-paren-newline
book => book.BorrowedBook.returned === false | ||
); | ||
} else if (req.query && req.query.returned === 'true') { | ||
books = user.Books.filter( |
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.
Unexpected newline after '(' function-paren-newline
if (req.query && req.query.returned === 'false') { | ||
books = user.Books.filter( | ||
book => book.BorrowedBook.returned === false | ||
); |
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.
Unexpected newline before ')' function-paren-newline
*/ | ||
|
||
getUser(req, res) { | ||
const username = req.body.username; |
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.
Use object destructuring prefer-destructuring
isAdmin, | ||
membershipType, | ||
} = user; | ||
const jwtOptions = { id, email, username, isAdmin, membershipType }; |
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.
Expected a line break after this opening brace object-curly-newline
Expected a line break before this closing brace object-curly-newline
isAdmin, | ||
membershipType, | ||
} = user; | ||
const jwtOptions = { id, email, username, isAdmin, membershipType }; |
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.
Expected a line break after this opening brace object-curly-newline
Expected a line break before this closing brace object-curly-newline
|
||
createUser(req, res) { | ||
const username = req.body.username; | ||
const email = req.body.email; |
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.
Use object destructuring prefer-destructuring
*/ | ||
|
||
createUser(req, res) { | ||
const username = req.body.username; |
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.
Use object destructuring prefer-destructuring
What does this PR do?
adds google login
Description of Task to be completed?
Users should be able to sign up with their Google account
How should this be manually tested?
login to the application with Google account
Any background context you want to provide?
N/A
What are the relevant pivotal tracker stories?
#149760621