dart_thingsboard_client icon indicating copy to clipboard operation
dart_thingsboard_client copied to clipboard

User registration support ?

Open amizer12 opened this issue 4 years ago • 4 comments

amizer12 avatar Sep 01 '21 19:09 amizer12

Hi, Does this client support user registration nad password reset ?

amizer12 avatar Sep 01 '21 19:09 amizer12

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});

vvlladd28 avatar Sep 02 '21 13:09 vvlladd28

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

pdt590 avatar Feb 01 '23 10:02 pdt590

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

bymelihkara avatar Jan 30 '24 16:01 bymelihkara