I've attempted to create a custom self registration page using the Communities Self registration, along with the Site.login and process builder (flows).
Essentially using various steps, when a user's email is verified on a CTA I attempted to activate a user a record and assign permission sets in the same transaction. But due to Salesforce limitation of Mixed DML operation of Non-setup and setup object in the same transaction this process does not seem to work. I wanted this two transactions to happen right away so that when the user was logged in they would be able to properly access all functionality.
Are there any ideas as to how I can attempt my scenario or process?
Currently I came up with the idea of activating the user record right away and having the assign permission sets run as a future or queueable, and when they log in, we first send them to a generic welcome page. Upon clicking on the CTA or button on that page I will look to use Apex Action poller to continuously check if the permissions have been set until we send them to the desired page, but I was wondering or looking to see if there was a better method. Thank you.