put the authentication in index instead of loginAction