Skip to content
This repository was archived by the owner on Dec 27, 2021. It is now read-only.

Possible Issue with locale in registration getCode #33

Open
stollr opened this issue Nov 23, 2015 · 1 comment
Open

Possible Issue with locale in registration getCode #33

stollr opened this issue Nov 23, 2015 · 1 comment

Comments

@stollr
Copy link

stollr commented Nov 23, 2015

In the getCode function that could be found in src/http/registration.js is a potential issue with the locale. The code says:

return {
    getCode: function(countryCode, phone, onready, onerror, deviceId, mcc, mnc, locale, method) {
      var params = Object.create(null);
      params['cc'] = countryCode;
      params['in'] = phone;
      params['lc'] = locale.split('-')[1] || 'GB';
      params['lg'] = locale.split('-')[0] || 'en';
      // ....
}

If "de" is passed as locale, params['lc'] will be equal to "GB" and params['lg'] will be equal to "de". This seems wrong to me. Does params['lc'] has to be filled? And what would happen if it stays empty (empty string, null or undefined)?

Another question: if the user registers with another locale like "de-DE", does the exists - function in the same file still work? As params['lg'] and params['lc'] is hardcoded to 'en' and 'GB'.

      params['lg'] = 'en';
      params['lc'] = 'GB';
@stollr
Copy link
Author

stollr commented Nov 28, 2015

ping @willyaranda

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant