For GA4 via Tag Manager
1
Pass the parameter to dataLayer
On every page load after login, pass the relevant parameter
user_id to your dataLayer.2
Create a GTM variable
Create a Variable inside GTM that reads that value from the dataLayer.

3
Send the property to GA4
Under the Configuration Parameter section of your GA4 Google Tag, add a new row with the user_id property and the corresponding Value (the Data Layer variable you created in step 2).

For GA4 using gtag.js
Pass a unique user ID after login to track users across sessions on different devices using theuser_id config parameter.