Better way for invited users to Create A Password

I was told that after 30-90 days, logged in users are automatically logged out.
I haven’t used this, since I’m not having much luck with the durability of custom codes, but this was also suggested for inactive users: