add authentication and check if the user has logged in