-
Notifications
You must be signed in to change notification settings - Fork 9
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
#167574878 Facebook Social Login #17
Conversation
@@ -0,0 +1,28 @@ | |||
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.
Parsing error: 'import' and 'export' may appear only with 'sourceType: module'
test/user/socialLogin.test.js
Outdated
@@ -0,0 +1,43 @@ | |||
import chai from 'chai'; |
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.
Parsing error: 'import' and 'export' may appear only with 'sourceType: module'
test/user/index.test.js
Outdated
@@ -0,0 +1,3 @@ | |||
import socialLogin from './socialLogin.test'; |
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.
Parsing error: 'import' and 'export' may appear only with 'sourceType: module'
@@ -0,0 +1,8 @@ | |||
import express from 'express'; |
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.
Parsing error: 'import' and 'export' may appear only with 'sourceType: module'
@@ -0,0 +1,17 @@ | |||
import express from 'express'; |
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.
Parsing error: 'import' and 'export' may appear only with 'sourceType: module'
server/helpers/passportError.js
Outdated
@@ -0,0 +1,4 @@ | |||
export default (error, req, res, next) => { |
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.
Parsing error: 'import' and 'export' may appear only with 'sourceType: module'
@@ -0,0 +1,16 @@ | |||
import passport from 'passport'; |
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.
Parsing error: 'import' and 'export' may appear only with 'sourceType: module'
@@ -0,0 +1,16 @@ | |||
import passport from 'passport'; |
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.
Parsing error: 'import' and 'export' may appear only with 'sourceType: module'
server/helpers/SocialAuth.js
Outdated
@@ -0,0 +1,31 @@ | |||
/* eslint-disable require-jsdoc */ | |||
import Debug from 'debug'; |
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.
Parsing error: 'import' and 'export' may appear only with 'sourceType: module'
server/database/models/user.js
Outdated
@@ -0,0 +1,12 @@ | |||
export default (sequelize, DataTypes) => { |
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.
Parsing error: 'import' and 'export' may appear only with 'sourceType: module'
072b15f
to
070a327
Compare
server/index.js
Outdated
resave: true, | ||
saveUninitialized: 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
server/index.js
Outdated
@@ -22,6 +21,13 @@ app.use(logger('dev')); | |||
app.use(json()); | |||
app.use(urlencoded({ extended: false })); | |||
app.use('/api-docs', swaggerUi.serve, swaggerUi.setup(swaggerDoc)); | |||
app.use( |
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
cb(null, profile); | ||
} | ||
) | ||
); |
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
import { Strategy as FacebookStrategy } from 'passport-facebook'; | ||
|
||
export default () => { | ||
passport.use( |
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
070a327
to
f7f1600
Compare
serialize = sinon.stub(passport, 'serializeUser').yields({}, () => {}); | ||
deserialize = sinon.stub(passport, 'deserializeUser').yields({}, () => {}); | ||
sinons = sinon.stub(User, 'findOne').returns(false); | ||
passportUse = sinon.stub(passport, 'use').callsFake(({}) => {}); |
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 empty object pattern no-empty-pattern
server/helpers/passportCallback.js
Outdated
* @param {function} done express next function | ||
* @returns {JSON} JSON object with details of new user | ||
*/ | ||
const callback = (accessToken, refreshToken, profile, done) => done(null, profile); |
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.
Line 11 exceeds the maximum line length of 80 max-len
f7f1600
to
08c31bd
Compare
|
||
const { expect } = chai; | ||
chai.use(chaiHttp); | ||
let serialize, deserialize, sinons, passportUse; |
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.
'passportUse' is defined but never used. Allowed unused vars must match /should|expect/ no-unused-vars
24133b0
to
38d5436
Compare
38d5436
to
6cd00cd
Compare
6cd00cd
to
e5f011d
Compare
server/controllers/Auth.js
Outdated
userName: givenName | ||
} | ||
}); | ||
console.log('my users', users); |
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
server/controllers/Auth.js
Outdated
import { | ||
generateToken, | ||
serverResponse, | ||
serverError, |
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.
'serverError' is defined but never used. Allowed unused vars must match /should|expect/ no-unused-vars
import models from '../database/models'; | ||
import { | ||
generateToken, | ||
serverResponse, |
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.
'serverResponse' is defined but never used. Allowed unused vars must match /should|expect/ no-unused-vars
1842077
to
98a95ee
Compare
98a95ee
to
e722d24
Compare
* @param {function} done express next function | ||
* @returns {JSON} JSON object with details of new user | ||
*/ | ||
const callback = (accessToken, refreshToken, profile, done) => done(null, profile); |
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.
Line 9 exceeds the maximum line length of 80 max-len
e722d24
to
985de51
Compare
dcf9ec5
ff2b2b7
to
dcf9ec5
Compare
* @returns {Object} facebookUserData with details of new user | ||
*/ | ||
const facebookData = (request) => { | ||
const { email } = request.user._json; |
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 dangling '_' in '_json' no-underscore-dangle
b054fa8
to
7a0c25a
Compare
server/controllers/Auth.js
Outdated
userAgent, | ||
ipAddress: ip | ||
}; | ||
const Data = await createSocialUsers(data); |
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.
Data -> user
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.
noted thanks
ef869be
7a0c25a
to
ef869be
Compare
#167573212 Implement Login Feature
ef869be
to
6c19aed
Compare
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.
@Adekoreday please be aware that this code will be refactored entirely when implementing Google and Twitter, because the logic will remain the same asides how we retrieve user data from the payload returned by passport callback. Please always think in the big picture when implementing solutions.
Enable Social Login using facebook
What does this PR do?
Description of Task proposed in this pull request?
How should this be manually tested (Quality Assurance)?
What are the relevant pivotal tracker stories?
167574878
Any background context you want to add (Operations Impact)?
What I have learned working on this feature:
I learned how to enable facebook login using passport.js
I learned how to stub functions using sinon.js
Screenshots: