Adding before() to check if the user is authenticated or not.