The only way I get the login/logout to work is by adding SERVICE_URL as dependency to this directive, and a line
```
SERVICE_URL = SERVICE_URL.replace(/\\:/, ':');
```
and changing this line to 
```
scope.url = SERVICE_URL + '/auth/google';
```
and line 15 to
```
scope.url = SERVICE_URL + '/auth/logout';
```

, but I'm wondering if we should do this differently, instead add a angular controller authCtrl with routes #/auth/login and #/auth/logout,  that sends a ajax call to the backend and redirects back to referer with a authenticated ( true or false ) state based on ajax return.

or we can skip the controller, but instead of setting scope.url here, we send a ajax call, and then based on return from it we set authenticated ( true or false ) state and redirect back to referer.