Skip to content
This repository was archived by the owner on Mar 17, 2025. It is now read-only.

Commit 6ce1402

Browse files
committed
Add a changePassword method to $firebaseAuth, fixes #177
1 parent c585a78 commit 6ce1402

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

angularfire.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -612,6 +612,7 @@ AngularFireAuth.prototype = {
612612
}
613613
},
614614

615+
// Creates a user for Firebase Simple Login.
615616
// Function 'cb' receives an error as the first argument and a
616617
// Simple Login user object as the second argument. Pass noLogin=true
617618
// if you don't want the newly created user to also be logged in.
@@ -637,6 +638,24 @@ AngularFireAuth.prototype = {
637638
});
638639
},
639640

641+
// Changes the password for a Firebase Simple Login user.
642+
// Take an email, old password and new password as three mandatory arguments.
643+
// An optional callback may be specified to be notified when the password
644+
// has been changed successfully.
645+
changePassword: function(email, old, np, cb) {
646+
var self = this;
647+
self._authClient.changePassword(email, old, np, function(err, user) {
648+
if (err) {
649+
self._rootScope.$broadcast("$firebaseAuth:error", err);
650+
}
651+
if (cb) {
652+
self._timeout(function() {
653+
cb(err, user);
654+
});
655+
}
656+
});
657+
},
658+
640659
// Common function to trigger a login event on the root scope.
641660
_loggedIn: function(user) {
642661
var self = this;

angularfire.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)