firebase / firebase/firebase-js-sdk

Config interface should have all properties readonly

Open
#7,589 1 comment 0 reactions 0 assignees View on GitHub
api: auth feature request
Dominant language
TypeScript
Stars
5.1k
Forks
1k
Avg merge
2d 21h
Merged PRs (30d)
37

Description

### Operating System

macOS

### Browser Version

Safari 16.5.2

### Firebase SDK Version

10.1.0

### Firebase SDK Product:

Auth

### Describe your project's tooling

index.html with source tag.

### Describe the problem

I am talking about this interface

```
export interface Config {
/**
* The API Key used to communicate with the Firebase Auth backend.
*/
apiKey: string;
/**
* The host at which the Firebase Auth backend is running.
*/
apiHost: string;
/**
* The scheme used to communicate with the Firebase Auth backend.
*/
apiScheme: string;
/**
* The host at which the Secure Token API is running.
*/
tokenApiHost: string;
/**
* The SDK Client Version.
*/
sdkClientVersion: string;
/**
* The domain at which the web widgets are hosted (provided via Firebase Config).
*/
authDomain?: string;
}
```

I think the fact that the properties are not readonly is an oversight. These properties don't seem to be supposed to be changeable after an auth instance is fetched. The `EmulatorConfig` interface, also used by the Auth interface, has all of its properties set to readonly.

### Steps and code to reproduce issue

```
const auth = getAuth();
auth.config.apiKey = "blablabla";//I don't think this is intended to be possible
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.