diff --git a/src/ng-token-auth.coffee b/src/ng-token-auth.coffee index e5ad534b..f5d003fa 100644 --- a/src/ng-token-auth.coffee +++ b/src/ng-token-auth.coffee @@ -222,10 +222,7 @@ angular.module('ng-token-auth', ['ipCookie']) $rootScope.$broadcast('auth:login-success', @user) ) .error((resp) => - @rejectDfd({ - reason: 'unauthorized' - errors: ['Invalid credentials'] - }) + @rejectDfd(angular.merge({reason: 'unauthorized', errors: ['Invalid credentials']}, resp)) $rootScope.$broadcast('auth:login-error', resp) ) @dfd.promise