Skip to content

Commit cfa47bc

Browse files
committed
style(app): fix some issues TSLint was complaining about
1 parent 22d46d5 commit cfa47bc

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

Diff for: app/templates/client/components/auth(auth)/auth.service.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ function AuthService($location, $http, $cookies, $q, appConfig, Util, User) {
2020
* @param {Function} callback - optional, function(error, user)
2121
* @return {Promise}
2222
*/
23-
login(user, callback) {
23+
login({email, password}, callback) {
2424
return $http.post('/auth/local', {
25-
email: user.email,
26-
password: user.password
25+
email: email,
26+
password: password
2727
})
2828
.then(res => {
2929
$cookies.put('token', res.data.token);

Diff for: app/templates/client/components/auth(auth)/router.decorator.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
(function() {
44

55
angular.module('<%= scriptAppName %>.auth')
6-
.run(function($rootScope<% if (filters.ngroute) { %>, $location<% } if (filters.uirouter) { %>, $state<% } %>, Auth) {
6+
.run(function($rootScope<% if (filters.ngroute) { %>, $location<% } if (filters.uirouter) { %>, $state<% } %>, Auth) {
77
// Redirect to login if route requires auth and the user is not logged in, or doesn't have required role
8-
$rootScope.$on(<% if (filters.ngroute) { %>'$routeChangeStart'<% } %><% if (filters.uirouter) { %>'$stateChangeStart'<% } %>, function(event, next) {
9-
if(!next.authenticate) {
8+
$rootScope.$on(<% if (filters.ngroute) { %>'$routeChangeStart'<% } %><% if (filters.uirouter) { %>'$stateChangeStart'<% } %>, function(event, next) {
9+
if (!next.authenticate) {
1010
return;
1111
}
1212

13-
if(typeof next.authenticate === 'string') {
13+
if (typeof next.authenticate === 'string') {
1414
Auth.hasRole(next.authenticate, _.noop).then(has => {
15-
if(has) {
15+
if (has) {
1616
return;
1717
}
1818

@@ -24,7 +24,7 @@ angular.module('<%= scriptAppName %>.auth')
2424
});
2525
} else {
2626
Auth.isLoggedIn(_.noop).then(is => {
27-
if(is) {
27+
if (is) {
2828
return;
2929
}
3030

@@ -33,7 +33,7 @@ angular.module('<%= scriptAppName %>.auth')
3333
$state.go('main');<% } %>
3434
});
3535
}
36-
});
36+
});
3737
});
3838

3939
})();

Diff for: app/templates/client/components/auth(auth)/user.service.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ function UserResource($resource) {
99
changePassword: {
1010
method: 'PUT',
1111
params: {
12-
controller:'password'
12+
controller: 'password'
1313
}
1414
},
1515
get: {
1616
method: 'GET',
1717
params: {
18-
id:'me'
18+
id: 'me'
1919
}
2020
}
2121
});

0 commit comments

Comments
 (0)