Save token to localStorage

Save token to localStorage as well as $cookieStore to support sites running in local filesystems with no cookie support (e.g. inside cordova apps).
This check on `auth` is different to the one on line `L149` that determines whether to return it. There it's using `angular.isDefined(auth)`. Should this conditional not be the same?
```js
if (!angular.isDefined(auth) && $window.localStorage)
```