Updates
This commit is contained in:
@@ -26,6 +26,7 @@ export default async function handleSocialDb({
|
||||
}: HandleSocialDbFunctionParams): Promise<APIResponseObject> {
|
||||
try {
|
||||
const finalDbName = database;
|
||||
const MAX_IMAGE_STRING_LENGTH = 350;
|
||||
|
||||
const existingSocialUserQUery = `SELECT * FROM users WHERE email = ? AND social_login='1' AND social_platform = ? `;
|
||||
const existingSocialUserValues = [email, social_platform];
|
||||
@@ -127,6 +128,14 @@ export default async function handleSocialDb({
|
||||
};
|
||||
|
||||
Object.keys(payload).forEach((key) => {
|
||||
if (key.match(/image/)) {
|
||||
const imageString = payload[key] as string | undefined;
|
||||
if (
|
||||
!imageString ||
|
||||
imageString.length > MAX_IMAGE_STRING_LENGTH
|
||||
)
|
||||
return;
|
||||
}
|
||||
data[key] = payload[key];
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user