question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Setting auth.languageCode is impossible due to PromiseProxy.

See original GitHub issue

This issue comes from the PromiseProxy and the fact that languageCode is both a getter and setter.

Version info

Angular:@angular/core”: “~10.1.4”, Firebase: “firebase”: “^7.19.1”, AngularFire:@angular/fire”: “^6.0.2”,

How to reproduce these conditions

// Try to change AngularFIreAuth languageCode
this.fireAuth.languageCode = 'fr';
// This fails because "Type 'string' is not assignable to type 'Promise<string>'."
// This comes from the PromiseProxy and the fact that languageCode is both a getter and setter.

// Setting to a Promise doesn't have any effect.
this.fireAuth.languageCode = new Promise(() => 'fr');

Expected behavior

I should be able to change the languageCode of the auth Object, to send email action templates in the user’s language.

Actual behavior

The languageCode property doesn’t work with the PromiseProxy. All email action templates are sent with the default Firebase Console language setting.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
jamesdanielscommented, Nov 13, 2020

6.1.0-rc.2 now has USE_DEVICE_LANGUAGE and LANGUAGE_CODE DI tokens which allow configuration of the auth language.

1reaction
kertofcommented, Oct 19, 2020

Fantastic!

As a current workaround, I use firebase directly, with a delay, to make sure the app is initialized by AngularFire first.

import * as firebase from 'firebase/app';
import 'firebase/auth';

firebase.auth().languageCode = langCode;

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to change the language of the message sent in Firebase ...
Use the languageCode property of Auth to specify a language for the user. Here is the entry for that in JS, but it's...
Read more >
Auth interface - JavaScript API reference - Firebase - Google
The Auth instance's language code. This is a readable/writable property. When set to null, the default Firebase Console language setting is applied.
Read more >
How can I use firebase's language code (myFirebase.auth ...
I am trying to use Firebase Authentication to verify the email address that is provided by the user during sign up.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found