# Hook/lock custom parameter

**URL:** <https://community.auth0.com/t/hook-lock-custom-parameter/7582>\
**Category:** Get Help\
**Tags:** hooks, lock\
**Created:** [July 19, 2017, 7:08pm UTC](https://community.auth0.com/t/hook-lock-custom-parameter/7582 "2017-07-19T19:08:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jontycurtis](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jontycurtis/32/7771_2.png) [@jontycurtis](https://community.auth0.com/u/jontycurtis)\
**Post date:** [July 19, 2017, 7:08pm UTC](https://community.auth0.com/t/hook-lock-custom-parameter/7582/1 "2017-07-19T19:08:03Z")

</div>

I’m passing a custom parameter to the lock with no issues:  
webAuth.authorise({ foo: ‘bar’ });  
I’d like to be able to access this parameter in the pre-registration hook, but can’t figure out if there is a way to do this.

---

<div class="post-metadata">

**Author:** ![prashantT](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/prashantt/32/6002_2.png) [@prashantT](https://community.auth0.com/u/prashantT)\
**Post date:** [July 20, 2017, 6:28am UTC](https://community.auth0.com/t/hook-lock-custom-parameter/7582/2 "2017-07-20T06:28:39Z")

</div>

[Pre-registration Hooks](https://auth0.com/docs/hooks/extensibility-points/pre-user-registration) only run during sign up events; the webAuth.authorize() method is a login method, rather than a sign up method. You can pass a custom parameter during the signup as follows:

```
webAuth.signup({ 
	connection: 'Username-Password-Authentication', 
	email: $('.signup-email').val(), 
	password: $('.signup-password').val(),
	user_metadata: {
		foo: 'bar'
	}
}, function (err) { 
	if (err) return alert('Something went wrong: ' + err.message); 
	    return alert('success signup without login!') 
}); 

```

You can then access the `user.user_metadata.foo` property in the pre-registration hook.

---

<div class="post-metadata">

**Author:** ![jontycurtis](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jontycurtis/32/7771_2.png) [@jontycurtis](https://community.auth0.com/u/jontycurtis)\
**Post date:** [July 20, 2017, 2:48pm UTC](https://community.auth0.com/t/hook-lock-custom-parameter/7582/3 "2017-07-20T14:48:44Z")

</div>

Thanks for the response. webAuth.Authorize({ foo: ‘bar’ }) is the way we sign users up. We are using the hosted login page and the lock there is configured to allow signups. I can access “foo” in the lock using config.extraParams with no issues. The question is how do we pass “foo” from the lock on the hosted login page to the pre-reg hook? The scenario here is a trusted client, so there are no issues with the users potentially being able to change “foo”.

For the time being, I’m using a hacky work around, which is to create a pre-filled custom field on the sign-up using additionalSignUpFields which I then hide using CSS.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [March 2, 2018, 5:55am UTC](https://community.auth0.com/t/hook-lock-custom-parameter/7582/4 "2018-03-02T05:55:29Z")

</div>


