-
Notifications
You must be signed in to change notification settings - Fork 5
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
bg: Fix social login bugs #52
base: develop
Are you sure you want to change the base?
Conversation
src/controllers/socialLogin.js
Outdated
@@ -17,6 +17,7 @@ const createUser = async (newUser, res, displayName) => { | |||
}; | |||
|
|||
const displayOutput = async (req, res, displayName) => { | |||
console.log(req.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.
Unexpected console statement no-console
- edited the route for gogole route.
8963f8c
to
ade4490
Compare
src/middlewares/multerUploads.js
Outdated
storage, | ||
limits: { fileSize: MAX_IMAGE_SIZE } | ||
}); | ||
export default multerUploads; |
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.
Newline required at end of file but not found eol-last
src/middlewares/multerUploads.js
Outdated
const multerUploads = multer({ | ||
storage, | ||
limits: { fileSize: MAX_IMAGE_SIZE } | ||
}); |
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 line break before this closing brace object-curly-newline
src/middlewares/multerUploads.js
Outdated
export default multerUploads; | ||
allowedFormat: ['jpg', 'png', 'jpeg'] | ||
}); | ||
const multerUploads = multer({ |
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 line break after this opening brace object-curly-newline
src/middlewares/multerUploads.js
Outdated
limits: { fileSize: MAX_IMAGE_SIZE } }); | ||
export default multerUploads; | ||
allowedFormat: ['jpg', 'png', 'jpeg'] | ||
}); |
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 line break before this closing brace object-curly-newline
src/middlewares/multerUploads.js
Outdated
@@ -10,9 +10,13 @@ const MAX_IMAGE_SIZE = 1 * 1024 * 1024; // Maximum allowed image size: 1MB | |||
|
|||
const cdnConnect = cloudinaryConfig(); | |||
|
|||
const storage = cloudinaryStorage({ cloudinary, | |||
const storage = cloudinaryStorage({ |
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 line break after this opening brace object-curly-newline
src/controllers/socialLogin.js
Outdated
const { displayName } = req.user; | ||
await displayOutput(req, res, displayName); | ||
}, | ||
const userInfo = { |
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 line break after this opening brace object-curly-newline
src/controllers/socialLogin.js
Outdated
email: req.user.emails[0].value, | ||
image: req.user.photos[0].value, | ||
provider: req.user.provider, }); | ||
provider: req.user.provider, | ||
}); |
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 line break before this closing brace object-curly-newline
src/controllers/socialLogin.js
Outdated
} | ||
}; | ||
|
||
const displayOutput = async (req, res, displayName) => { | ||
const newUser = await User.create({ firstName: req.user.name.givenName, | ||
const newUser = await User.create({ |
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 line break after this opening brace object-curly-newline
src/controllers/socialLogin.js
Outdated
return res.status(201).json({ | ||
message: `Welcome to Authors Haven ${displayName} `, | ||
data: { token, firstName, lastName, username, 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 line break before this closing brace object-curly-newline
src/controllers/socialLogin.js
Outdated
@@ -11,41 +11,49 @@ const createUser = async (newUser, res, displayName) => { | |||
} | |||
} = newUser; | |||
const token = await tokenGeneration.generateToken(newUser.dataValues); | |||
return res.status(201).json({ message: `Welcome to Authors Haven ${displayName} `, | |||
data: { token, firstName, lastName, username, email }, }); | |||
return res.status(201).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 line break after this opening brace object-curly-newline
- edited the route for gogole route. - Added validations back to user profile amend
ade4490
to
42b1b2f
Compare
image.version | ||
}/${image.public_id}.${image.format}` | ||
} | ||
}) |
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 line break before this closing brace object-curly-newline
circle: `${IMAGE_BASE_URL}/w_120,c_fill,ar_1:1,g_auto,r_max,bo_5px_solid_red,b_rgb:262c35/v${ | ||
image.version | ||
}/${image.public_id}.${image.format}` | ||
} |
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 line break before this closing brace object-curly-newline
}/${image.public_id}.${image.format}`, | ||
circle: `${IMAGE_BASE_URL}/w_120,c_fill,ar_1:1,g_auto,r_max,bo_5px_solid_red,b_rgb:262c35/v${ | ||
image.version | ||
}/${image.public_id}.${image.format}` |
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 10 spaces but found 12 indent
}`, | ||
square: `${IMAGE_BASE_URL}/w_320,ar_1:1,c_fill,g_auto,e_art:hokusai/v${ | ||
image.version | ||
}/${image.public_id}.${image.format}`, |
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 10 spaces but found 12 indent
original: `v${image.version}/${image.public_id}.${image.format}`, | ||
thumbnail: `${IMAGE_BASE_URL}/w_600/v${image.version}/${image.public_id}.${ | ||
image.format | ||
}`, |
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 10 spaces but found 12 indent
})) | ||
&& res.status(201).json({ | ||
status: 201, | ||
message: { |
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 line break after this opening brace object-curly-newline
image: `${image.version}/${image.public_id}.${image.format}`, | ||
userId: req.user.id | ||
})) | ||
&& res.status(201).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 line break after this opening brace object-curly-newline
? (await Gallery.save({ | ||
image: `${image.version}/${image.public_id}.${image.format}`, | ||
userId: 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.
Unexpected line break before this closing brace object-curly-newline
circle: `${IMAGE_BASE_URL}/w_120,c_fill,ar_1:1,g_auto,r_max,bo_5px_solid_red,b_rgb:262c35/v${ | ||
image.version | ||
}/${image.public_id}.${image.format}` } }) | ||
? (await Gallery.save({ |
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 line break after this opening brace object-curly-newline
@@ -14,21 +14,28 @@ export default class UploadController { | |||
* @returns {object} Object representing the response returned | |||
*/ | |||
static async save(req, res) { | |||
console.log('idhar aya hai kya'); |
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
5f57bab
to
ee09afa
Compare
- edited the route for gogole route. - Added validations back to user profile amend
010752e
to
907d21a
Compare
9483c03
to
1f5cf67
Compare
5640a7b
to
642cee5
Compare
642cee5
to
606dc55
Compare
606dc55
to
38ee2d9
Compare
What does this PR do?
Description of Task to be completed?
How should this be manually tested?