Hi,
It isn't clear to me how your custom authentication works with mojoPortal. Are you setting an auth token, are you creating a site user in the mp_Sites table, those thing would be needed. If the page is protected by roles and the user is not authenticated from mojoportal's point of view they would be redirected to login.
If mojoPortal detects an authentication cookie but cannot retrieve a corresponding site user from the database it will redirect to logout the user and force him to login again. This can also happen if a user changes the email address on their account (or login name if not using email for login) from one web browser while still logged in from another web browser. This happens by design because the user is looked up in the database based on the name in the auth cookie so if the user changes it from a different web browser then the user is not found in the other web browser since it no longer matches his email or login name.
So my best guess is you are not creating a mojo site user corresponding to the custom authentication. In mojoPortal when using LDAP or Active Directory, or when using Windows Authentication for example we automatically create a site user if one does not exist upon authentication. You would need to do the same in your custom solution.
Hope that helps,
Joe