Skip to content

Fix idp provider constructor signatures in auth #3958

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

Merged
merged 3 commits into from
Oct 20, 2020
Merged
Show file tree
Hide file tree
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
12 changes: 4 additions & 8 deletions common/api-review/auth-exp.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ export class EmailAuthProvider implements externs.EmailAuthProvider {

// @public (undocumented)
export class FacebookAuthProvider extends OAuthProvider {
constructor();
// (undocumented)
static credential(accessToken: string): externs.OAuthCredential;
// (undocumented)
Expand All @@ -133,8 +134,6 @@ export class FacebookAuthProvider extends OAuthProvider {
static readonly FACEBOOK_SIGN_IN_METHOD = externs.SignInMethod.FACEBOOK;
// (undocumented)
static readonly PROVIDER_ID = externs.ProviderId.FACEBOOK;
// (undocumented)
readonly providerId = externs.ProviderId.FACEBOOK;
}

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

// @public (undocumented)
export class GithubAuthProvider extends OAuthProvider {
constructor();
// (undocumented)
static credential(accessToken: string): externs.OAuthCredential;
// (undocumented)
Expand All @@ -170,12 +170,11 @@ export class GithubAuthProvider extends OAuthProvider {
static readonly GITHUB_SIGN_IN_METHOD = externs.SignInMethod.GITHUB;
// (undocumented)
static readonly PROVIDER_ID = externs.ProviderId.GITHUB;
// (undocumented)
readonly providerId = externs.ProviderId.GITHUB;
}

// @public (undocumented)
export class GoogleAuthProvider extends OAuthProvider {
constructor();
// (undocumented)
static credential(idToken?: string | null, accessToken?: string | null): externs.OAuthCredential;
// (undocumented)
Expand All @@ -186,8 +185,6 @@ export class GoogleAuthProvider extends OAuthProvider {
static readonly GOOGLE_SIGN_IN_METHOD = externs.SignInMethod.GOOGLE;
// (undocumented)
static readonly PROVIDER_ID = externs.ProviderId.GOOGLE;
// (undocumented)
readonly providerId = externs.ProviderId.GOOGLE;
}

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

// @public (undocumented)
export class TwitterAuthProvider extends OAuthProvider {
constructor();
// (undocumented)
static credential(token: string, secret: string): externs.OAuthCredential;
// (undocumented)
Expand All @@ -413,8 +411,6 @@ export class TwitterAuthProvider extends OAuthProvider {
// (undocumented)
static readonly PROVIDER_ID = externs.ProviderId.TWITTER;
// (undocumented)
readonly providerId = externs.ProviderId.TWITTER;
// (undocumented)
static readonly TWITTER_SIGN_IN_METHOD = externs.SignInMethod.TWITTER;
}

Expand Down
13 changes: 13 additions & 0 deletions docs-exp/auth.facebookauthprovider._constructor_.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@firebase/auth](./auth.md) &gt; [FacebookAuthProvider](./auth.facebookauthprovider.md) &gt; [(constructor)](./auth.facebookauthprovider._constructor_.md)

## FacebookAuthProvider.(constructor)

Constructs a new instance of the `FacebookAuthProvider` class

<b>Signature:</b>

```typescript
constructor();
```
7 changes: 6 additions & 1 deletion docs-exp/auth.facebookauthprovider.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,18 @@ export declare class FacebookAuthProvider extends OAuthProvider
```
<b>Extends:</b> [OAuthProvider](./auth.oauthprovider.md)

## Constructors

| Constructor | Modifiers | Description |
| --- | --- | --- |
| [(constructor)()](./auth.facebookauthprovider._constructor_.md) | | Constructs a new instance of the <code>FacebookAuthProvider</code> class |

## Properties

| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [FACEBOOK\_SIGN\_IN\_METHOD](./auth.facebookauthprovider.facebook_sign_in_method.md) | <code>static</code> | (not declared) | |
| [PROVIDER\_ID](./auth.facebookauthprovider.provider_id.md) | <code>static</code> | (not declared) | |
| [providerId](./auth.facebookauthprovider.providerid.md) | | (not declared) | |

## Methods

Expand Down
13 changes: 13 additions & 0 deletions docs-exp/auth.githubauthprovider._constructor_.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@firebase/auth](./auth.md) &gt; [GithubAuthProvider](./auth.githubauthprovider.md) &gt; [(constructor)](./auth.githubauthprovider._constructor_.md)

## GithubAuthProvider.(constructor)

Constructs a new instance of the `GithubAuthProvider` class

<b>Signature:</b>

```typescript
constructor();
```
7 changes: 6 additions & 1 deletion docs-exp/auth.githubauthprovider.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,18 @@ export declare class GithubAuthProvider extends OAuthProvider
```
<b>Extends:</b> [OAuthProvider](./auth.oauthprovider.md)

## Constructors

| Constructor | Modifiers | Description |
| --- | --- | --- |
| [(constructor)()](./auth.githubauthprovider._constructor_.md) | | Constructs a new instance of the <code>GithubAuthProvider</code> class |

## Properties

| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [GITHUB\_SIGN\_IN\_METHOD](./auth.githubauthprovider.github_sign_in_method.md) | <code>static</code> | (not declared) | |
| [PROVIDER\_ID](./auth.githubauthprovider.provider_id.md) | <code>static</code> | (not declared) | |
| [providerId](./auth.githubauthprovider.providerid.md) | | (not declared) | |

## Methods

Expand Down
13 changes: 13 additions & 0 deletions docs-exp/auth.googleauthprovider._constructor_.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@firebase/auth](./auth.md) &gt; [GoogleAuthProvider](./auth.googleauthprovider.md) &gt; [(constructor)](./auth.googleauthprovider._constructor_.md)

## GoogleAuthProvider.(constructor)

Constructs a new instance of the `GoogleAuthProvider` class

<b>Signature:</b>

```typescript
constructor();
```
7 changes: 6 additions & 1 deletion docs-exp/auth.googleauthprovider.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,18 @@ export declare class GoogleAuthProvider extends OAuthProvider
```
<b>Extends:</b> [OAuthProvider](./auth.oauthprovider.md)

## Constructors

| Constructor | Modifiers | Description |
| --- | --- | --- |
| [(constructor)()](./auth.googleauthprovider._constructor_.md) | | Constructs a new instance of the <code>GoogleAuthProvider</code> class |

## Properties

| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [GOOGLE\_SIGN\_IN\_METHOD](./auth.googleauthprovider.google_sign_in_method.md) | <code>static</code> | (not declared) | |
| [PROVIDER\_ID](./auth.googleauthprovider.provider_id.md) | <code>static</code> | (not declared) | |
| [providerId](./auth.googleauthprovider.providerid.md) | | (not declared) | |

## Methods

Expand Down
13 changes: 13 additions & 0 deletions docs-exp/auth.twitterauthprovider._constructor_.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@firebase/auth](./auth.md) &gt; [TwitterAuthProvider](./auth.twitterauthprovider.md) &gt; [(constructor)](./auth.twitterauthprovider._constructor_.md)

## TwitterAuthProvider.(constructor)

Constructs a new instance of the `TwitterAuthProvider` class

<b>Signature:</b>

```typescript
constructor();
```
7 changes: 6 additions & 1 deletion docs-exp/auth.twitterauthprovider.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,17 @@ export declare class TwitterAuthProvider extends OAuthProvider
```
<b>Extends:</b> [OAuthProvider](./auth.oauthprovider.md)

## Constructors

| Constructor | Modifiers | Description |
| --- | --- | --- |
| [(constructor)()](./auth.twitterauthprovider._constructor_.md) | | Constructs a new instance of the <code>TwitterAuthProvider</code> class |

## Properties

| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [PROVIDER\_ID](./auth.twitterauthprovider.provider_id.md) | <code>static</code> | (not declared) | |
| [providerId](./auth.twitterauthprovider.providerid.md) | | (not declared) | |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do these providerid.md files get deleted?

| [TWITTER\_SIGN\_IN\_METHOD](./auth.twitterauthprovider.twitter_sign_in_method.md) | <code>static</code> | (not declared) | |

## Methods
Expand Down
2 changes: 1 addition & 1 deletion packages-exp/auth-compat-exp/src/auth.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ describe('auth compat', () => {
if (typeof self !== 'undefined') {
sinon.stub(underlyingAuth, '_getPersistence').returns('TEST');
// eslint-disable-next-line @typescript-eslint/no-floating-promises
authCompat.signInWithRedirect(new impl.GoogleAuthProvider('google'));
authCompat.signInWithRedirect(new impl.GoogleAuthProvider());
expect(
sessionStorage.getItem('firebase:persistence:api-key:undefined')
).to.eq('TEST');
Expand Down
5 changes: 4 additions & 1 deletion packages-exp/auth-exp/src/core/providers/facebook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ import { OAuthProvider } from './oauth';
export class FacebookAuthProvider extends OAuthProvider {
static readonly FACEBOOK_SIGN_IN_METHOD = externs.SignInMethod.FACEBOOK;
static readonly PROVIDER_ID = externs.ProviderId.FACEBOOK;
readonly providerId = FacebookAuthProvider.PROVIDER_ID;

constructor() {
super(externs.ProviderId.FACEBOOK);
}

static credential(accessToken: string): externs.OAuthCredential {
return OAuthCredential._fromParams({
Expand Down
5 changes: 4 additions & 1 deletion packages-exp/auth-exp/src/core/providers/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ import { OAuthProvider } from './oauth';
export class GithubAuthProvider extends OAuthProvider {
static readonly GITHUB_SIGN_IN_METHOD = externs.SignInMethod.GITHUB;
static readonly PROVIDER_ID = externs.ProviderId.GITHUB;
readonly providerId = GithubAuthProvider.PROVIDER_ID;

constructor() {
super(externs.ProviderId.GITHUB);
}

static credential(accessToken: string): externs.OAuthCredential {
return OAuthCredential._fromParams({
Expand Down
5 changes: 4 additions & 1 deletion packages-exp/auth-exp/src/core/providers/google.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ import { OAuthProvider } from './oauth';
export class GoogleAuthProvider extends OAuthProvider {
static readonly GOOGLE_SIGN_IN_METHOD = externs.SignInMethod.GOOGLE;
static readonly PROVIDER_ID = externs.ProviderId.GOOGLE;
readonly providerId = GoogleAuthProvider.PROVIDER_ID;

constructor() {
super(externs.ProviderId.GOOGLE);
}

static credential(
idToken?: string | null,
Expand Down
5 changes: 4 additions & 1 deletion packages-exp/auth-exp/src/core/providers/twitter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ import { OAuthProvider } from './oauth';
export class TwitterAuthProvider extends OAuthProvider {
static readonly TWITTER_SIGN_IN_METHOD = externs.SignInMethod.TWITTER;
static readonly PROVIDER_ID = externs.ProviderId.TWITTER;
readonly providerId = TwitterAuthProvider.PROVIDER_ID;

constructor() {
super(externs.ProviderId.TWITTER);
}

static credential(token: string, secret: string): externs.OAuthCredential {
return OAuthCredential._fromParams({
Expand Down