Currently we are using a custom self registration page on community to allow users to register for the community. As a part of this registration process, we want to assign a default profile picture to the user which is different from the one provided by Salesforce chatter.
When I try to update the profile picture using setPhoto method of ConnectApi in user trigger, I get an error.
Guest user does not have access to this method.
I have tried using
@futuremethods and also tried using
without sharing on apex trigger. Chatter methods executing based on the current users context regardless of the execution context is causing the issue here.
If anyone faced a similar issue and have figured out the solution to this, please post an answer.
Basically, my goal here is to be able to set the profile picture of the user to a default pic when they sign up using the self registration form. Thanks.