Skip to content
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

Merged
merged 2 commits into from
Nov 14, 2017
Merged

Feature/google signin #50

merged 2 commits into from
Nov 14, 2017

Conversation

segunolalive
Copy link
Owner

@segunolalive segunolalive commented Nov 14, 2017

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

@segunolalive segunolalive temporarily deployed to segunolalive-hellobooks-pr-50 November 14, 2017 16:18 Inactive
import userController from '../controllers/users';
import bookController from '../controllers/books';
import userController from '../controllers/userController';
import bookController from '../controllers/bookController';

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';

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

error,
}));
})});

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

@@ -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);

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

const username = email.slice(0, email.indexOf('@'));
const firstName = googleProfile.getGivenName();
const lastName = googleProfile.getFamilyName();
console.log(username, firstName, lastName, email);

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

responseGoogle(response) {
const googleProfile = response.getBasicProfile();
const email = googleProfile.getEmail();
const id = googleProfile.getId();

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

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 64.4% when pulling 3acba1b on feature/google-signin into 3c92451 on development.

return res.status(200).send({
message: 'An password reset link has been sent to your email',
});
});

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),

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
);

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(

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
);

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;

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 };

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 };

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;

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;

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

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.05%) to 64.529% when pulling 6a8153c on feature/google-signin into 3c92451 on development.

@segunolalive segunolalive merged commit 4796e25 into development Nov 14, 2017
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.

None yet

3 participants