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

[Auth] Add setters for tenantId and languageCode to auth compat #5109

Merged
merged 2 commits into from
Jul 2, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions packages-exp/auth-compat-exp/src/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ import { ReverseWrapper, Wrapper } from './wrap';
const _assert: typeof exp._assert = exp._assert;

export class Auth
implements compat.FirebaseAuth, Wrapper<exp.Auth>, _FirebaseService {
implements compat.FirebaseAuth, Wrapper<exp.Auth>, _FirebaseService
{
readonly _delegate: exp.AuthImpl;

constructor(readonly app: FirebaseApp, provider: Provider<'auth-exp'>) {
Expand Down Expand Up @@ -107,12 +108,18 @@ export class Auth
get languageCode(): string | null {
return this._delegate.languageCode;
}
set languageCode(languageCode: string | null) {
this._delegate.languageCode = languageCode;
}
get settings(): compat.AuthSettings {
return this._delegate.settings;
}
get tenantId(): string | null {
return this._delegate.tenantId;
}
set tenantId(tid: string | null) {
this._delegate.tenantId = tid;
}
useDeviceLanguage(): void {
this._delegate.useDeviceLanguage();
}
Expand Down Expand Up @@ -348,7 +355,7 @@ export class Auth
return this._delegate._delete();
}
private linkUnderlyingAuth(): void {
((this._delegate as unknown) as ReverseWrapper<Auth>).wrapped = () => this;
(this._delegate as unknown as ReverseWrapper<Auth>).wrapped = () => this;
}
}

Expand Down