dart_thingsboard_client
dart_thingsboard_client copied to clipboard
User registration support ?
Hi, Does this client support user registration nad password reset ?
Hi @amizer12, This client support resetPaswort:
var tbClient = ThingsboardClient('https://demo.thingsboard.io');
await tbClient.sendResetPasswordLink(String email, {RequestConfig? requestConfig});
Registration user:
await tbClient.getUserService().saveUser(User user,
{bool sendActivationMail = false, RequestConfig? requestConfig});
Hi, Does this client support user registration nad password reset ?
@amizer12: do you have any ideal to do this? Solution from @vvlladd28 seems not correct. I cannot find out how to register a new user with email and pass.
Thanks
try { if (await connect("[email protected]", "tenantpassword")) { await tbClient .getUserService() .saveUser(User(username, Authority.TENANT_ADMIN), sendActivationMail: false) .then((value) { tbClient.getUserService().activateUser( value.getId()!.id.toString(), password, requestConfig: RequestConfig( ignoreErrors: false, ignoreLoading: false, resendRequest: false)); }); return true; } else { return false; } } catch (e) { return false; } I created and activated the user like this