# How to pass user's language selection to React application

**URL:** <https://community.auth0.com/t/how-to-pass-users-language-selection-to-react-application/50105>\
**Category:** Get Help\
**Tags:** reactjs, lock\
**Created:** [September 21, 2020, 6:49am UTC](https://community.auth0.com/t/how-to-pass-users-language-selection-to-react-application/50105 "2020-09-21T06:49:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![daveanders](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/daveanders/32/12776_2.png) [@daveanders](https://community.auth0.com/u/daveanders)\
**Post date:** [September 21, 2020, 6:49am UTC](https://community.auth0.com/t/how-to-pass-users-language-selection-to-react-application/50105/1 "2020-09-21T06:49:51Z")

</div>

Hi,

We have implemented Universal login with classical lock widget and have a working language switcher which switches languages of Auth0 widget.

However we would like to pass the selected language to our ReactJS application where user is logging on from Auth0 in order to reduce duplicate language selection.

Please help! All hints that show the right direction are appreciated.

---

<div class="post-metadata">

**Author:** ![mathiasconradt](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/mathiasconradt/32/12758_2.png) [@mathiasconradt](https://community.auth0.com/u/mathiasconradt)\
**Post date:** [September 21, 2020, 8:24am UTC](https://community.auth0.com/t/how-to-pass-users-language-selection-to-react-application/50105/2 "2020-09-21T08:24:05Z")

</div>

This question came up a few times in the forum:

> [@How to pass custom parameter to a custom OAuth2 connection?](https://community.auth0.com/t/how-to-pass-custom-parameter-to-a-custom-oauth2-connection/6709/6):
>
> As mentioned in the comments, the additional parameters that can be sent need to be recognized by the receiving endpoint which is mostly expecting OpenID Connect/OAuth2 standards parameters or some custom parameters already being used by popular providers. For example, this would be the case for the access\_type parameter mentioned in the docs. Despite this requirement custom OAuth2 connections can be configured to automatically map a known and accepted parameter, like the access\_type one, to a …

[https://community.auth0.com/t/passing-additional-inputs-from-universal-login-page/39581/8?u=mathiasconradt](https://community.auth0.com/t/passing-additional-inputs-from-universal-login-page/39581/8)

Another option, in case it’s not mentioned in the linked questions, to use different callback urls, something like [https://callback/?lang=de](https://callback/?lang=de) and [https://callback/?lang=en](https://callback/?lang=en)

---

<div class="post-metadata">

**Author:** ![daveanders](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/daveanders/32/12776_2.png) [@daveanders](https://community.auth0.com/u/daveanders)\
**Post date:** [September 21, 2020, 10:40am UTC](https://community.auth0.com/t/how-to-pass-users-language-selection-to-react-application/50105/3 "2020-09-21T10:40:42Z")

</div>

As I understand what you are trying to say is. In the login customisation html I can add some javascript that would somehow enrich the callback URL with ?language=lang, and then I could capture it on the front-end.

So how can I access and modify callback URL from Login customization script?

There have been couple of threads about this, but all are dead, for instance: [Add Parameter to Callback URL - #5](https://community.auth0.com/t/add-parameter-to-callback-url/21003/5)

---

<div class="post-metadata">

**Author:** ![mathiasconradt](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/mathiasconradt/32/12758_2.png) [@mathiasconradt](https://community.auth0.com/u/mathiasconradt)\
**Post date:** [September 21, 2020, 11:21am UTC](https://community.auth0.com/t/how-to-pass-users-language-selection-to-react-application/50105/4 "2020-09-21T11:21:35Z")

</div>

Sorry, I misread the initial scenario. My thought was to add the parameter in the authorize call that you’re making from your client application (as opposed to the login page). I see that you wanted to have the switch in the Auth0 Login Page. In this case, it’s afaik not possible with the out of the box Login widget (Lock) that Auth0 provides on the login page.
