optimized authentication to have normal URL in homapage after logging in