Feature: Save google profile picture of the user during account creation
Description
This PR saves the google profile picture of the user during account creation.
Demo
Closes - #249
@SH4LIN In my test cases, media_handle_sideload() wasn't handling the temporary files correctly. Even though the MIME types were valid, it rejected the files because they had a .tmp extension, resulting in the error: "You are not allowed to upload the given file type." When the correct extension was set to the file according it's mime type, it worked.
@SH4LIN In my test cases,
media_handle_sideload()wasn't handling the temporary files correctly. Even though the MIME types were valid, it rejected the files because they had a.tmpextension, resulting in the error: "You are not allowed to upload the given file type." When the correct extension was set to the file according it's mime type, it worked.
If that's the case then another option is this, we identify mime, and ext from our end pass it to the file array with key type and ext. Can we check whether this solution works or not.
"You can change your profile picture on Gravatar."
Wouldn't this be confusing? Currently, the feature only updates the image during registration. We should either periodically check for updates, add a button to re-sync the image, or enhance the feature to also check the profile image during login.
At the moment, I can think of two ways to make it better.
- Override the defaule Profile Picture section to handle the removal and upload of the picture.
Before:
After:
- Create a new section called
Google Profile Pictureand a global setting to override the default avatar.
LMK your thoughts on this.
cc @SH4LIN @joelabreo227
@SH4LIN In my test cases,
media_handle_sideload()wasn't handling the temporary files correctly. Even though the MIME types were valid, it rejected the files because they had a.tmpextension, resulting in the error: "You are not allowed to upload the given file type." When the correct extension was set to the file according it's mime type, it worked.If that's the case then another option is this, we identify mime, and ext from our end pass it to the file array with key type and ext. Can we check whether this solution works or not.
I'm not sure why, but during my second test, the .tmp files were no longer created. Now, every profile picture is saved with the correct file extension. Also, we can provide the MIME type, but not the file extension directly — the extension comes from the filename itself. The media_handle_sideload() function throws an error if the file extension doesn’t match the MIME type.
