the auth service and directive of avoscloud based on Angular.js