Angular redirect to Auth0 login without clicking button

I am new to Auth0 and i would like to integrate Auth0 to my Angular project. Most of the online resources said we need to click a button then redirect to Auth0 login page but i would like to the user land to my homepage and it will redirect the user to Auth0 login page.
I had tried to put loginWithRedirect() in my homepage contructor but it will keep back and forth the Auth0 login page and my mainpage after successful login then cause the infinity loop. Could anyone suggest a solution for me. Thanks