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

[166240824] Enable Social Login via Google and Facebook #19

Merged
merged 6 commits into from
Jun 25, 2019

Conversation

Ramadhan0
Copy link
Contributor

@Ramadhan0 Ramadhan0 commented Jun 12, 2019

What does this PR do?

Signup and Login user via google, facebook and twitter

Description of Task to be completed?

Have this point working
  • Get /api/auth/facebook: this is the endpoint, a user will hit whenever he/she wants to log in or signup using facebook.
  • Get /api/auth/google: this is the endpoint, a user will hit whenever he/she wants to log in or signup using google.
  • Get /api/auth/twitter: this is the endpoint, a user will hit whenever he/she wants to log in or signup using twitter.

How should this be manually tested?

  • Clone the repo by typing git clone https://github.com/andela/savage_rangers-ah into the terminal

  • Run the server with this command npm run dev

  • Test it with your browser by typing:

    localhost:3001/api/users/google
    localhost:3001/api/users/facebook
    localhost:3001/api/users/twitter

What are the relevant pivotal tracker stories?

166240824

  • Test social login in your browser by typing:

localhost:3001/api/users/google

Screen Shot 2019-06-20 at 08 29 39

localhost:3001/api/users/facebook

Screen Shot 2019-06-20 at 08 30 28

localhost:3001/api/users/twitter

Screen Shot 2019-06-20 at 08 31 08

@Ramadhan0 Ramadhan0 added the WIP Work in progress label Jun 12, 2019
@Ramadhan0 Ramadhan0 force-pushed the ft-SocialLogin-#166240824 branch 5 times, most recently from 012a090 to b73c289 Compare June 13, 2019 19:58
@Ramadhan0 Ramadhan0 marked this pull request as ready for review June 13, 2019 20:25
@Ramadhan0 Ramadhan0 force-pushed the ft-SocialLogin-#166240824 branch 20 times, most recently from d6d2a89 to 78f0605 Compare June 17, 2019 07:30
@Ramadhan0 Ramadhan0 force-pushed the ft-SocialLogin-#166240824 branch 2 times, most recently from b28b1b9 to 5dba265 Compare June 20, 2019 18:11
provider: req.user.provider,
uniqueId: req.user.id
});
const token = generateToken({ username: req.user.displayName, id: req.user.id },
Copy link
Contributor

Choose a reason for hiding this comment

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

here it is nor the id from the req.user but from the table's dataValues

src/api/controllers/socialAuth.js Show resolved Hide resolved
provider: req.user.provider,
uniqueId: req.user.id
});
const token = generateToken({ username: req.user.displayName, id: req.user.id },
Copy link
Contributor

Choose a reason for hiding this comment

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

the same here

@@ -0,0 +1,39 @@
/**
Copy link
Contributor

Choose a reason for hiding this comment

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

you still have hound issue

@truestbyheart
Copy link
Contributor

Please put the get request in caps GET in your PR description.

@truestbyheart
Copy link
Contributor

Please can you refer to @MCFrank16 or @truestbyheart PR to see how they have written this part.

@Ramadhan0 Ramadhan0 force-pushed the ft-SocialLogin-#166240824 branch 3 times, most recently from e19db4d to d09a33f Compare June 25, 2019 10:55
package.json Outdated
@@ -5,6 +5,7 @@
"main": "index.js",
"scripts": {
"start": "babel-node src/index.js",
"setup": "NODE_ENV=test npm run migrate:undo && NODE_ENV=test npm run migrate && NODE_ENV=test npm run seed",
Copy link
Contributor

Choose a reason for hiding this comment

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

@Ramadhan0 why do you need this?

@@ -68,5 +67,6 @@ export default {
type: Sequelize.DATE
}
}),
// eslint-disable-next-line no-unused-vars
Copy link
Contributor

Choose a reason for hiding this comment

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

@Ramadhan0 why are you disabling this eslint rule?

@@ -7,8 +7,7 @@ export default {
type: Sequelize.INTEGER
},
username: {
type: Sequelize.STRING,
unique: true
type: Sequelize.STRING
Copy link
Contributor

Choose a reason for hiding this comment

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

@Ramadhan0 username should be unique.

@@ -0,0 +1,51 @@
export default {
Copy link
Contributor

Choose a reason for hiding this comment

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

@Ramadhan0 why do you have this file in your work?

@@ -0,0 +1,10 @@
'use strict';
Copy link
Contributor

Choose a reason for hiding this comment

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

@Ramadhan0 same with this file. why is it here?

@MemunaHaruna MemunaHaruna merged commit fc66117 into develop Jun 25, 2019
@MemunaHaruna MemunaHaruna deleted the ft-SocialLogin-#166240824 branch June 25, 2019 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants