-
Notifications
You must be signed in to change notification settings - Fork 8
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
Conversation
012a090
to
b73c289
Compare
d6d2a89
to
78f0605
Compare
b28b1b9
to
5dba265
Compare
5dba265
to
83334cd
Compare
src/api/controllers/socialAuth.js
Outdated
provider: req.user.provider, | ||
uniqueId: req.user.id | ||
}); | ||
const token = generateToken({ username: req.user.displayName, id: req.user.id }, |
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.
here it is nor the id from the req.user but from the table's dataValues
src/api/controllers/socialAuth.js
Outdated
provider: req.user.provider, | ||
uniqueId: req.user.id | ||
}); | ||
const token = generateToken({ username: req.user.displayName, id: req.user.id }, |
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.
the same here
@@ -0,0 +1,39 @@ | |||
/** |
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.
you still have hound issue
09e6765
to
e5354dd
Compare
Please put the |
Please can you refer to @MCFrank16 or @truestbyheart PR to see how they have written this part. |
e19db4d
to
d09a33f
Compare
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", |
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.
@Ramadhan0 why do you need this?
@@ -68,5 +67,6 @@ export default { | |||
type: Sequelize.DATE | |||
} | |||
}), | |||
// eslint-disable-next-line no-unused-vars |
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.
@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 |
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.
@Ramadhan0 username should be unique.
@@ -0,0 +1,51 @@ | |||
export default { |
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.
@Ramadhan0 why do you have this file in your work?
src/api/models/test-articl.js
Outdated
@@ -0,0 +1,10 @@ | |||
'use strict'; |
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.
@Ramadhan0 same with this file. why is it here?
d09a33f
to
4deeaf5
Compare
4deeaf5
to
fc75178
Compare
What does this PR do?
Signup and Login user via google, facebook and twitter
Description of Task to be completed?
Have this point working
/api/auth/facebook
: this is the endpoint, a user will hit whenever he/she wants to log in or signup using facebook./api/auth/google
: this is the endpoint, a user will hit whenever he/she wants to log in or signup using google./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 terminalRun 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
localhost:3001/api/users/google
localhost:3001/api/users/facebook
localhost:3001/api/users/twitter