     )
 
 angular.module('holmesApp')
-  .service('AuthSrvc', ($rootScope, $cookies, $location, Restangular, GooglePlus, $localStorage, UserViolationsPrefsFcty, WebSocketFcty) ->
-    return new AuthService($rootScope, $cookies, $location, Restangular, GooglePlus, $localStorage, UserViolationsPrefsFcty)
+  .service('AuthSrvc', ($rootScope, $location, Restangular, GooglePlus, $localStorage, UserViolationsPrefsFcty, WebSocketFcty) ->
+    return new AuthService($rootScope, $location, Restangular, GooglePlus, $localStorage, UserViolationsPrefsFcty)
   )

'use strict'

class AuthService
  constructor: (@rootScope, @cookies, @location, @restangular, @googlePlus, @localStorage, @UserViolationsPrefsFcty) ->
    @cookieName = 'HOLMES_AUTH_TOKEN'
    @getAuthenticationFlags()
    @bindEvents()


    if @rootScope.isSuperUser is false
      @location.url path

  logout: ->
    @removeAuthentication().then((result) =>
      if result.loggedOut
        @rootScope.isLoggedIn = false
        @location.url "/login"
    )

  googleLogin: ->
    @googlePlus.login().then((authResult) =>
