Skip to content

$fn.resetPassword(param)

Reset application authenticated user passwords."asynchronous"

Arguments

NameTypeDescription
paramobjectInformation about the user whose password is to be reset

param details

PropertyTypeDescription
emailstringEmail
passwordstringTemporary password

Return value

TypeDescription
PromisePassword reset user information
ObjectPropertyTypeDescription
UseruserIdstringUser ID (GUID)
emailstringEmail
namestringName
custom_01stringCustom Attribute 1
custom_02stringCustom Attribute 2
custom_03stringCustom Attribute 3
custom_04stringCustom Attribute 4
custom_05stringCustom Attribute 5
custom_06stringCustom Attribute 6
custom_07stringCustom Attribute 7
custom_08stringCustom Attribute 8
custom_09stringCustom Attribute 9
custom_10stringCustom Attribute 10
enabledbooleanEnable/Disable
createdstringCreation date and time
updatedstringUpdate date and time
statusstringUser Status

Sample

try {
/* CSV content
* ------------------------------------
* "email","password"
* "user01@test.co.jp","Password@01"
* "user02@test.co.jp","Password@02"
* ------------------------------------
*/
const file = await $fn.getFile('/resetPassword.csv');
const buffer = file.data;
const resetPWInfos = $fn.csvToObject(buffer);
// reset password
for (let resetPWInfo of resetPWInfos) {
await $fn.resetPassword(resetPWInfo);
}
} catch(err) {
console.log("Error", err);
}