Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.

Commit f47fffb

Browse files
authored
Implement user reload in iOS
Fixed #483
1 parent b0b17d7 commit f47fffb

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

firebase.ios.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1428,6 +1428,32 @@ firebase.reauthenticate = function (arg) {
14281428
});
14291429
};
14301430

1431+
firebase.reload = function () {
1432+
return new Promise(function (resolve, reject) {
1433+
try {
1434+
var user = FIRAuth.auth().currentUser;
1435+
1436+
if (user === null) {
1437+
reject("no current user");
1438+
return;
1439+
}
1440+
1441+
var onCompletion = function (error) {
1442+
if (error) {
1443+
reject(error.localizedDescription);
1444+
} else {
1445+
resolve();
1446+
}
1447+
};
1448+
1449+
user.reloadWithCompletion(onCompletion);
1450+
} catch (ex) {
1451+
console.log("Error in firebase.reload: " + ex);
1452+
reject(ex);
1453+
}
1454+
});
1455+
};
1456+
14311457
firebase.resetPassword = function (arg) {
14321458
return new Promise(function (resolve, reject) {
14331459
try {

0 commit comments

Comments
 (0)