Skip to content

Commit ca04eda

Browse files
authored
Fix idp provider constructor signatures in auth (#3958)
* Fix the standard idp providers * Formatting, test fix * Auth docs update
1 parent ef33328 commit ca04eda

14 files changed

+97
-17
lines changed

common/api-review/auth-exp.api.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ export class EmailAuthProvider implements externs.EmailAuthProvider {
123123

124124
// @public (undocumented)
125125
export class FacebookAuthProvider extends OAuthProvider {
126+
constructor();
126127
// (undocumented)
127128
static credential(accessToken: string): externs.OAuthCredential;
128129
// (undocumented)
@@ -133,8 +134,6 @@ export class FacebookAuthProvider extends OAuthProvider {
133134
static readonly FACEBOOK_SIGN_IN_METHOD = externs.SignInMethod.FACEBOOK;
134135
// (undocumented)
135136
static readonly PROVIDER_ID = externs.ProviderId.FACEBOOK;
136-
// (undocumented)
137-
readonly providerId = externs.ProviderId.FACEBOOK;
138137
}
139138

140139
// @public (undocumented)
@@ -160,6 +159,7 @@ export function getRedirectResult(authExtern: externs.Auth, resolverExtern?: ext
160159

161160
// @public (undocumented)
162161
export class GithubAuthProvider extends OAuthProvider {
162+
constructor();
163163
// (undocumented)
164164
static credential(accessToken: string): externs.OAuthCredential;
165165
// (undocumented)
@@ -170,12 +170,11 @@ export class GithubAuthProvider extends OAuthProvider {
170170
static readonly GITHUB_SIGN_IN_METHOD = externs.SignInMethod.GITHUB;
171171
// (undocumented)
172172
static readonly PROVIDER_ID = externs.ProviderId.GITHUB;
173-
// (undocumented)
174-
readonly providerId = externs.ProviderId.GITHUB;
175173
}
176174

177175
// @public (undocumented)
178176
export class GoogleAuthProvider extends OAuthProvider {
177+
constructor();
179178
// (undocumented)
180179
static credential(idToken?: string | null, accessToken?: string | null): externs.OAuthCredential;
181180
// (undocumented)
@@ -186,8 +185,6 @@ export class GoogleAuthProvider extends OAuthProvider {
186185
static readonly GOOGLE_SIGN_IN_METHOD = externs.SignInMethod.GOOGLE;
187186
// (undocumented)
188187
static readonly PROVIDER_ID = externs.ProviderId.GOOGLE;
189-
// (undocumented)
190-
readonly providerId = externs.ProviderId.GOOGLE;
191188
}
192189

193190
// @public (undocumented)
@@ -404,6 +401,7 @@ export function signOut(auth: externs.Auth): Promise<void>;
404401

405402
// @public (undocumented)
406403
export class TwitterAuthProvider extends OAuthProvider {
404+
constructor();
407405
// (undocumented)
408406
static credential(token: string, secret: string): externs.OAuthCredential;
409407
// (undocumented)
@@ -413,8 +411,6 @@ export class TwitterAuthProvider extends OAuthProvider {
413411
// (undocumented)
414412
static readonly PROVIDER_ID = externs.ProviderId.TWITTER;
415413
// (undocumented)
416-
readonly providerId = externs.ProviderId.TWITTER;
417-
// (undocumented)
418414
static readonly TWITTER_SIGN_IN_METHOD = externs.SignInMethod.TWITTER;
419415
}
420416

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [@firebase/auth](./auth.md) &gt; [FacebookAuthProvider](./auth.facebookauthprovider.md) &gt; [(constructor)](./auth.facebookauthprovider._constructor_.md)
4+
5+
## FacebookAuthProvider.(constructor)
6+
7+
Constructs a new instance of the `FacebookAuthProvider` class
8+
9+
<b>Signature:</b>
10+
11+
```typescript
12+
constructor();
13+
```

docs-exp/auth.facebookauthprovider.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,18 @@ export declare class FacebookAuthProvider extends OAuthProvider
1111
```
1212
<b>Extends:</b> [OAuthProvider](./auth.oauthprovider.md)
1313
14+
## Constructors
15+
16+
| Constructor | Modifiers | Description |
17+
| --- | --- | --- |
18+
| [(constructor)()](./auth.facebookauthprovider._constructor_.md) | | Constructs a new instance of the <code>FacebookAuthProvider</code> class |
19+
1420
## Properties
1521
1622
| Property | Modifiers | Type | Description |
1723
| --- | --- | --- | --- |
1824
| [FACEBOOK\_SIGN\_IN\_METHOD](./auth.facebookauthprovider.facebook_sign_in_method.md) | <code>static</code> | (not declared) | |
1925
| [PROVIDER\_ID](./auth.facebookauthprovider.provider_id.md) | <code>static</code> | (not declared) | |
20-
| [providerId](./auth.facebookauthprovider.providerid.md) | | (not declared) | |
2126
2227
## Methods
2328
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [@firebase/auth](./auth.md) &gt; [GithubAuthProvider](./auth.githubauthprovider.md) &gt; [(constructor)](./auth.githubauthprovider._constructor_.md)
4+
5+
## GithubAuthProvider.(constructor)
6+
7+
Constructs a new instance of the `GithubAuthProvider` class
8+
9+
<b>Signature:</b>
10+
11+
```typescript
12+
constructor();
13+
```

docs-exp/auth.githubauthprovider.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,18 @@ export declare class GithubAuthProvider extends OAuthProvider
1111
```
1212
<b>Extends:</b> [OAuthProvider](./auth.oauthprovider.md)
1313
14+
## Constructors
15+
16+
| Constructor | Modifiers | Description |
17+
| --- | --- | --- |
18+
| [(constructor)()](./auth.githubauthprovider._constructor_.md) | | Constructs a new instance of the <code>GithubAuthProvider</code> class |
19+
1420
## Properties
1521
1622
| Property | Modifiers | Type | Description |
1723
| --- | --- | --- | --- |
1824
| [GITHUB\_SIGN\_IN\_METHOD](./auth.githubauthprovider.github_sign_in_method.md) | <code>static</code> | (not declared) | |
1925
| [PROVIDER\_ID](./auth.githubauthprovider.provider_id.md) | <code>static</code> | (not declared) | |
20-
| [providerId](./auth.githubauthprovider.providerid.md) | | (not declared) | |
2126
2227
## Methods
2328
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [@firebase/auth](./auth.md) &gt; [GoogleAuthProvider](./auth.googleauthprovider.md) &gt; [(constructor)](./auth.googleauthprovider._constructor_.md)
4+
5+
## GoogleAuthProvider.(constructor)
6+
7+
Constructs a new instance of the `GoogleAuthProvider` class
8+
9+
<b>Signature:</b>
10+
11+
```typescript
12+
constructor();
13+
```

docs-exp/auth.googleauthprovider.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,18 @@ export declare class GoogleAuthProvider extends OAuthProvider
1111
```
1212
<b>Extends:</b> [OAuthProvider](./auth.oauthprovider.md)
1313
14+
## Constructors
15+
16+
| Constructor | Modifiers | Description |
17+
| --- | --- | --- |
18+
| [(constructor)()](./auth.googleauthprovider._constructor_.md) | | Constructs a new instance of the <code>GoogleAuthProvider</code> class |
19+
1420
## Properties
1521
1622
| Property | Modifiers | Type | Description |
1723
| --- | --- | --- | --- |
1824
| [GOOGLE\_SIGN\_IN\_METHOD](./auth.googleauthprovider.google_sign_in_method.md) | <code>static</code> | (not declared) | |
1925
| [PROVIDER\_ID](./auth.googleauthprovider.provider_id.md) | <code>static</code> | (not declared) | |
20-
| [providerId](./auth.googleauthprovider.providerid.md) | | (not declared) | |
2126
2227
## Methods
2328
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [@firebase/auth](./auth.md) &gt; [TwitterAuthProvider](./auth.twitterauthprovider.md) &gt; [(constructor)](./auth.twitterauthprovider._constructor_.md)
4+
5+
## TwitterAuthProvider.(constructor)
6+
7+
Constructs a new instance of the `TwitterAuthProvider` class
8+
9+
<b>Signature:</b>
10+
11+
```typescript
12+
constructor();
13+
```

docs-exp/auth.twitterauthprovider.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,17 @@ export declare class TwitterAuthProvider extends OAuthProvider
1111
```
1212
<b>Extends:</b> [OAuthProvider](./auth.oauthprovider.md)
1313
14+
## Constructors
15+
16+
| Constructor | Modifiers | Description |
17+
| --- | --- | --- |
18+
| [(constructor)()](./auth.twitterauthprovider._constructor_.md) | | Constructs a new instance of the <code>TwitterAuthProvider</code> class |
19+
1420
## Properties
1521
1622
| Property | Modifiers | Type | Description |
1723
| --- | --- | --- | --- |
1824
| [PROVIDER\_ID](./auth.twitterauthprovider.provider_id.md) | <code>static</code> | (not declared) | |
19-
| [providerId](./auth.twitterauthprovider.providerid.md) | | (not declared) | |
2025
| [TWITTER\_SIGN\_IN\_METHOD](./auth.twitterauthprovider.twitter_sign_in_method.md) | <code>static</code> | (not declared) | |
2126
2227
## Methods

packages-exp/auth-compat-exp/src/auth.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ describe('auth compat', () => {
4848
if (typeof self !== 'undefined') {
4949
sinon.stub(underlyingAuth, '_getPersistence').returns('TEST');
5050
// eslint-disable-next-line @typescript-eslint/no-floating-promises
51-
authCompat.signInWithRedirect(new impl.GoogleAuthProvider('google'));
51+
authCompat.signInWithRedirect(new impl.GoogleAuthProvider());
5252
expect(
5353
sessionStorage.getItem('firebase:persistence:api-key:undefined')
5454
).to.eq('TEST');

packages-exp/auth-exp/src/core/providers/facebook.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ import { OAuthProvider } from './oauth';
2626
export class FacebookAuthProvider extends OAuthProvider {
2727
static readonly FACEBOOK_SIGN_IN_METHOD = externs.SignInMethod.FACEBOOK;
2828
static readonly PROVIDER_ID = externs.ProviderId.FACEBOOK;
29-
readonly providerId = FacebookAuthProvider.PROVIDER_ID;
29+
30+
constructor() {
31+
super(externs.ProviderId.FACEBOOK);
32+
}
3033

3134
static credential(accessToken: string): externs.OAuthCredential {
3235
return OAuthCredential._fromParams({

packages-exp/auth-exp/src/core/providers/github.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ import { OAuthProvider } from './oauth';
2626
export class GithubAuthProvider extends OAuthProvider {
2727
static readonly GITHUB_SIGN_IN_METHOD = externs.SignInMethod.GITHUB;
2828
static readonly PROVIDER_ID = externs.ProviderId.GITHUB;
29-
readonly providerId = GithubAuthProvider.PROVIDER_ID;
29+
30+
constructor() {
31+
super(externs.ProviderId.GITHUB);
32+
}
3033

3134
static credential(accessToken: string): externs.OAuthCredential {
3235
return OAuthCredential._fromParams({

packages-exp/auth-exp/src/core/providers/google.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@ import { OAuthProvider } from './oauth';
2727
export class GoogleAuthProvider extends OAuthProvider {
2828
static readonly GOOGLE_SIGN_IN_METHOD = externs.SignInMethod.GOOGLE;
2929
static readonly PROVIDER_ID = externs.ProviderId.GOOGLE;
30-
readonly providerId = GoogleAuthProvider.PROVIDER_ID;
30+
31+
constructor() {
32+
super(externs.ProviderId.GOOGLE);
33+
}
3134

3235
static credential(
3336
idToken?: string | null,

packages-exp/auth-exp/src/core/providers/twitter.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@ import { OAuthProvider } from './oauth';
4444
export class TwitterAuthProvider extends OAuthProvider {
4545
static readonly TWITTER_SIGN_IN_METHOD = externs.SignInMethod.TWITTER;
4646
static readonly PROVIDER_ID = externs.ProviderId.TWITTER;
47-
readonly providerId = TwitterAuthProvider.PROVIDER_ID;
47+
48+
constructor() {
49+
super(externs.ProviderId.TWITTER);
50+
}
4851

4952
static credential(token: string, secret: string): externs.OAuthCredential {
5053
return OAuthCredential._fromParams({

0 commit comments

Comments
 (0)