resetPasswordByFirstLoginToken static method

Future<AuthResult> resetPasswordByFirstLoginToken(
  1. String token,
  2. String password
)

reset password by first time login token

Implementation

static Future<AuthResult> resetPasswordByFirstLoginToken(
    String token, String password) async {
  var body = jsonEncode({'token': token, 'password': Util.encrypt(password)});
  final Result result =
      await post('/api/v2/users/password/reset-by-first-login-token', body);
  AuthResult authResult = AuthResult(result);
  if (result.code == 200) {
    authResult.user = await createUser(result);
  }
  return authResult;
}