The hook first checks if the user object exists or if the authMode is ‘connect-only’ and a primaryWallet exists. If either of these conditions is true, the user is considered logged in.Next, it checks the user should have a primaryWallet due to embedded wallets being enabled. If the user should have a promaryWallet and it doesn’t exist, the user is not considered logged in, otherwise, they are considered logged in.