Implement custom directive to secure routes