You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The authentication API has two methods. Here I provide a possible implementation:
function getUserByPhoneNumber(phone, onComplete) {
return new Promise(function (resolve, reject) {
const result = _.find(self, self._auth.users, item => {
return item.phoneNumber === phone
})
if (result) {
if (onComplete) {
onComplete(null, result.clone())
}
resolve(result.clone())
} else {
const err = new Error('auth/user-not-found')
if (onComplete) {
onComplete(err, null)
}
reject(err)
}
})
}
function listUsers(limit, token = 0) {
return new Promise(function (resolve) {
const users = self_auth.users.slice(token, token + limit)
// Return list of user records and the next page token if available.
const result = {
users,
pageToken: (token + limit + 1) < self._auth.users.length ? token + 1 : null
}
if (!result.pageToken) {
delete result.pageToken
}
resolve(result)
})
}
The text was updated successfully, but these errors were encountered:
The authentication API has two methods. Here I provide a possible implementation:
The text was updated successfully, but these errors were encountered: