Docs for retrieveAccount method (#1127)

* Docs for retrieveAccount method

* fix setTimeout call
This commit is contained in:
blagoev 2017-07-08 20:30:25 +03:00 committed by Yavor Georgiev
parent 4b68730cfd
commit 516c39deaf
3 changed files with 19 additions and 3 deletions

View File

@ -5,6 +5,7 @@ vNext Release notes (TBD)
### Enhancements ### Enhancements
* Add support for Linking Objects (AKA Backlinks). * Add support for Linking Objects (AKA Backlinks).
* Add support for retrieving user account information.
### Bug fixes ### Bug fixes
* Node * Node

View File

@ -225,6 +225,23 @@ class User {
* @returns {Realm} * @returns {Realm}
*/ */
openManagementRealm() {} openManagementRealm() {}
/**
* Get account information for a user. (requires administrator privilidges)
* @param {string} provider - the provider to query for user account information (ex. 'password')
* @param {string} username - the target username which account information should be retrieved
* @returns - json object for the retrieved account information
* @example
* {
* "provider_id": "user@email.co",
* "provider": "password",
* "user": {
* "id": "06ac9a0a-a96a-4ee1-b53c-b05a7542035a",
* "isAdmin": true,
* }
* }
*/
retrieveAccount() {provider, username}
} }
/** /**

View File

@ -58,9 +58,7 @@ exports.createAdminUser = function () {
let isAdmin = newAdminUser.isAdmin; let isAdmin = newAdminUser.isAdmin;
user.logout(); user.logout();
if (!isAdmin) { if (!isAdmin) {
setTimeout(() => { setTimeout(waitForServerToUpdateAdminUser, 500);
waitForServerToUpdateAdminUser();
}, 500);
return; return;
} }