Page restriction

I’m doing an access restriction action em nodejs, as shown in the tutorial, Applying Security to your NodeJS pages
redirecting to the login page if the user is not logged in, but the action is not obeying.