Skip to content

Commit a5d489c

Browse files
committed
refactor(client): remove no-longer-needed extra async auth function params
1 parent 95f25af commit a5d489c

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

templates/app/client/components/auth(auth)/auth.service.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ export function AuthService($location, $http, $cookies, $q, appConfig, Util, Use
127127
* @return {Bool|Promise}
128128
*/
129129
isLoggedIn(callback) {
130-
return Auth.getCurrentUser(null)
130+
return Auth.getCurrentUser()
131131
.then(user => {
132132
var is = user.hasOwnProperty('role');
133133
safeCb(callback)(is);
@@ -152,7 +152,7 @@ export function AuthService($location, $http, $cookies, $q, appConfig, Util, Use
152152
* @return {Bool|Promise}
153153
*/
154154
hasRole(role, callback) {
155-
return Auth.getCurrentUser(null)
155+
return Auth.getCurrentUser()
156156
.then(user => {
157157
var has = user.hasOwnProperty('role')
158158
? hasRole(user.role, role)

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,21 @@ export function routerDecorator($rootScope<% if(filters.ngroute) { %>, $location
1010
}
1111

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

1818
event.preventDefault();
19-
return Auth.isLoggedIn(_.noop).then(is => {
19+
return Auth.isLoggedIn().then(is => {
2020
<%_ if(filters.ngroute) { _%>
2121
$location.path(is ? '/' : '/login');<% } %>
2222
<%_ if(filters.uirouter) { _%>
2323
$state.go(is ? 'main' : 'login');<% } %>
2424
});
2525
});
2626
} else {
27-
Auth.isLoggedIn(_.noop).then(is => {
27+
Auth.isLoggedIn().then(is => {
2828
if(is) {
2929
return;
3030
}

0 commit comments

Comments
 (0)