•  


language locale is not set after calling `setLanguageCode` & appears as "und" in Auth blocking function. · Issue #5825 · firebase/firebase-android-sdk · GitHub
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement . We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

language locale is not set after calling setLanguageCode & appears as "und" in Auth blocking function. #5825

Open
russellwheatley opened this issue Apr 3, 2024 · 2 comments
Labels
api: auth type: bug Something isn't working

Comments

@russellwheatley
Copy link
Member

russellwheatley commented Apr 3, 2024

[READ] Step 1: Are you in the right place?

Yes, right place.

[REQUIRED] Step 2: Describe your environment

  • Android Studio version: 2022.3.1
  • Firebase Component: Auth (Database, Firestore, Storage, Functions, etc)
  • Component version: 22.3.1

[REQUIRED] Step 3: Describe the problem

language locale in auth blocking function is "und" which means undetermined. This is occuring even when setting the language code.

First reported on FlutterFire repo: firebase/flutterfire#12519

This is not an issue on firebas-ios-sdk.

Logcat shows why it is "und":

2024-04-03 09:50:57.889 26056-26147 System                  io.flutter.plugins.firebase.tests    W  Ignoring header X-Firebase-Locale because its value was null.

Steps to reproduce:

I have a repo with reproduction here: https://github.com/russellwheatley/firebase-android

Here are the steps taken from README:

  1. Update applicationId & namespace in app/build.gradle to your app in your firebase project.
  2. Update app/google-services.json to your firebase project.
  3. Run npm i in backend/functions directory followed by npm run deploy to deploy the cloud functions to your firebase project.
  4. Run the app on an emulator and press the button in the bottom right hand corner to set the language, create a user and trigger the cloud function.
  5. Head to the cloud function logs and observe the locale as authBeforeUserCreated {"locale":"und",....other properties}. This should be "en-US".

Relevant Code:

FirebaseApp
 app
 = 
FirebaseApp
.
getInstance
();
            
FirebaseAuth
 auth
 = 
FirebaseAuth
.
getInstance
(
app
);

            
auth
.
setLanguageCode
(
"en-US"
);

            
auth
.
createUserWithEmailAndPassword
(
"test-email@testemail.com"
, 
"qwerty123"
).
addOnCompleteListener
(
task
 -> {
                
if
 (
task
.
isSuccessful
()) {
                    
Log
.
d
(
TAG
, 
"User created successfully"
);

                } 
else
 {
                    
Log
.
d
(
TAG
, 
"User creation failed"
);
                }
            });
@lehcar09
Copy link

Hi @russellwheatley , thank you for reporting the issue. I was able to reproduce the issue with the MCVE you shared. I noticed that eventhough the locale shows und the verification email language is correct. I’ll notify our engineers and see what we can do here.

@lehcar09 lehcar09 added the type: bug Something isn't working label Apr 9, 2024
@mauriciotogneri
Copy link

Hi @lehcar09 , any updates on this issue? Maybe a workaround?

Sign up for free to join this conversation on GitHub . Already have an account? Sign in to comment
Labels
api: auth type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants
- "漢字路" 한글한자자동변환 서비스는 교육부 고전문헌국역지원사업의 지원으로 구축되었습니다.
- "漢字路" 한글한자자동변환 서비스는 전통문화연구회 "울산대학교한국어처리연구실 옥철영(IT융합전공)교수팀"에서 개발한 한글한자자동변환기를 바탕하여 지속적으로 공동 연구 개발하고 있는 서비스입니다.
- 현재 고유명사(인명, 지명등)을 비롯한 여러 변환오류가 있으며 이를 해결하고자 많은 연구 개발을 진행하고자 하고 있습니다. 이를 인지하시고 다른 곳에서 인용시 한자 변환 결과를 한번 더 검토하시고 사용해 주시기 바랍니다.
- 변환오류 및 건의,문의사항은 juntong@juntong.or.kr로 메일로 보내주시면 감사하겠습니다. .
Copyright ⓒ 2020 By '전통문화연구회(傳統文化硏究會)' All Rights reserved.
 한국   대만   중국   일본