# failure on wixUsers.register 

**URL:** <https://forum.wixstudio.com/t/failure-on-wixusers-register/7931>\
**Category:** Ask the community\
**Tags:** question, code\
**Created:** [September 26, 2021, 1:24pm UTC](https://forum.wixstudio.com/t/failure-on-wixusers-register/7931 "2021-09-26T13:24:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tomoya](https://avatars.discourse-cdn.com/v4/letter/t/ecd19e/32.png) [@tomoya](https://forum.wixstudio.com/u/tomoya)\
**Post date:** [September 26, 2021, 1:24pm UTC](https://forum.wixstudio.com/t/failure-on-wixusers-register/7931/1 "2021-09-26T13:24:45Z")

</div>

When we use a custom form with code, and calling register API as a click callback, the `signup` request itself succeeds, and new member account is created successfully, but there is a runtime error on JavaScript saying `Cannot read properties of undefined`. This prevents us from proceeding post-registration callbacks such as notifications.

 ![](https://us1.discourse-cdn.com/wix/original/3X/b/9/b9571ff76eee1a7c3669f6abb4b4d18e75d0c0c4.png)

```javascript
workerLogger.js:103 Cannot read properties of undefined (reading 'status')
(anonymous) @ workerLogger.js:103
(anonymous) @ siteMembersSdkFactory.ts:223
(anonymous) @ tslib.es6.js:102
(anonymous) @ tslib.es6.js:83
a @ tslib.es6.js:73
Promise.then (async)

```

it seems the error comes from the code below in siteMembersSdkFactory.ts.

```javascript
const data = options?.recaptchaToken
				? await register(email, password, options)
				: await withCaptchaChallengeHandler((recaptchaToken) =>
						register(email, password, { ...(options || {}), recaptchaToken })
				  )
const response = {
  status: data.status,
  ...(data.approvalToken ? { approvalToken: data.approvalToken } : {}),
}

```

Is this a bug from SDK, or is there a way to avoid this error?

Thanks in advance. Tom
