Skip to content

Commit bce9c99

Browse files
committed
Merge pull request #1124 from dciccale/canary
app.coffee is missing preventDefault(); auth.service changePassword() chore
2 parents c81b8e6 + d7fc0a8 commit bce9c99

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

app/templates/client/app/app(coffee).coffee

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,6 @@ angular.module '<%= scriptAppName %>', [<%= angularModules %>]
3636
# Redirect to login if route requires auth and you're not logged in
3737
$rootScope.$on <% if (filters.ngroute) { %>'$routeChangeStart'<% } %><% if (filters.uirouter) { %>'$stateChangeStart'<% } %>, (event, next) ->
3838
Auth.isLoggedIn (loggedIn) ->
39+
event.preventDefault()
3940
<% if (filters.ngroute) { %>$location.path '/login'<% } %><% if (filters.uirouter) { %>$state.go 'login'<% } %> if next.authenticate and not loggedIn
4041
<% } %>

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ angular.module '<%= scriptAppName %>'
7676
oldPassword: oldPassword
7777
newPassword: newPassword
7878

79-
, (user) ->
80-
callback? null, user
79+
, () ->
80+
callback? null
8181

8282
, (err) ->
8383
callback? err

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ angular.module('<%= scriptAppName %>')
8888
return User.changePassword({ id: currentUser._id }, {
8989
oldPassword: oldPassword,
9090
newPassword: newPassword
91-
}, function(user) {
92-
return safeCb(callback)(null, user);
91+
}, function() {
92+
return safeCb(callback)(null);
9393
}, function(err) {
9494
return safeCb(callback)(err);
9595
}).$promise;

app/templates/server/api/user(auth)/user.controller.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ exports.changePassword = function(req, res, next) {
128128
<% if (filters.mongooseModels) { %>return user.saveAsync()<% }
129129
if (filters.sequelizeModels) { %>return user.save()<% } %>
130130
.then(function() {
131-
res.status(200).end();
131+
res.status(204).end();
132132
})
133133
.catch(validationError(res));
134134
} else {

0 commit comments

Comments
 (0)