Skip to content

Commit c0d29df

Browse files
committed
Formatting
1 parent c3b238b commit c0d29df

File tree

6 files changed

+64
-29
lines changed

6 files changed

+64
-29
lines changed

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@
1717

1818
import { expect } from 'chai';
1919

20-
import { OperationType, ProviderId, SignInMethod } from '@firebase/auth-types-exp';
20+
import {
21+
OperationType,
22+
ProviderId,
23+
SignInMethod
24+
} from '@firebase/auth-types-exp';
2125

2226
import { TEST_ID_TOKEN_RESPONSE } from '../../../test/helpers/id_token_response';
2327
import { testUser } from '../../../test/helpers/mock_auth';
@@ -40,7 +44,7 @@ describe('src/core/providers/facebook', () => {
4044
providerId: ProviderId.FACEBOOK,
4145
_tokenResponse: {
4246
...TEST_ID_TOKEN_RESPONSE,
43-
oauthAccessToken: 'access-token',
47+
oauthAccessToken: 'access-token'
4448
},
4549
operationType: OperationType.SIGN_IN
4650
});
@@ -56,7 +60,7 @@ describe('src/core/providers/facebook', () => {
5660
});
5761
(error as TaggedWithTokenResponse)._tokenResponse = {
5862
...TEST_ID_TOKEN_RESPONSE,
59-
oauthAccessToken: 'access-token',
63+
oauthAccessToken: 'access-token'
6064
};
6165

6266
const cred = FacebookAuthProvider.credentialFromError(error)!;

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@ export class FacebookAuthProvider extends OAuthProvider {
2828
static readonly PROVIDER_ID = externs.ProviderId.FACEBOOK;
2929
readonly providerId = FacebookAuthProvider.PROVIDER_ID;
3030

31-
static credential(
32-
accessToken: string
33-
): externs.OAuthCredential {
31+
static credential(accessToken: string): externs.OAuthCredential {
3432
return OAuthCredential._fromParams({
3533
providerId: FacebookAuthProvider.PROVIDER_ID,
3634
signInMethod: FacebookAuthProvider.FACEBOOK_SIGN_IN_METHOD,
@@ -66,9 +64,7 @@ export class FacebookAuthProvider extends OAuthProvider {
6664
}
6765

6866
try {
69-
return FacebookAuthProvider.credential(
70-
tokenResponse.oauthAccessToken
71-
);
67+
return FacebookAuthProvider.credential(tokenResponse.oauthAccessToken);
7268
} catch {
7369
return null;
7470
}

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@
1717

1818
import { expect } from 'chai';
1919

20-
import { OperationType, ProviderId, SignInMethod } from '@firebase/auth-types-exp';
20+
import {
21+
OperationType,
22+
ProviderId,
23+
SignInMethod
24+
} from '@firebase/auth-types-exp';
2125

2226
import { TEST_ID_TOKEN_RESPONSE } from '../../../test/helpers/id_token_response';
2327
import { testUser } from '../../../test/helpers/mock_auth';
@@ -40,7 +44,7 @@ describe('src/core/providers/github', () => {
4044
providerId: ProviderId.GITHUB,
4145
_tokenResponse: {
4246
...TEST_ID_TOKEN_RESPONSE,
43-
oauthAccessToken: 'access-token',
47+
oauthAccessToken: 'access-token'
4448
},
4549
operationType: OperationType.SIGN_IN
4650
});
@@ -56,7 +60,7 @@ describe('src/core/providers/github', () => {
5660
});
5761
(error as TaggedWithTokenResponse)._tokenResponse = {
5862
...TEST_ID_TOKEN_RESPONSE,
59-
oauthAccessToken: 'access-token',
63+
oauthAccessToken: 'access-token'
6064
};
6165

6266
const cred = GithubAuthProvider.credentialFromError(error)!;

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@ export class GithubAuthProvider extends OAuthProvider {
2828
static readonly PROVIDER_ID = externs.ProviderId.GITHUB;
2929
readonly providerId = GithubAuthProvider.PROVIDER_ID;
3030

31-
static credential(
32-
accessToken: string
33-
): externs.OAuthCredential {
31+
static credential(accessToken: string): externs.OAuthCredential {
3432
return OAuthCredential._fromParams({
3533
providerId: GithubAuthProvider.PROVIDER_ID,
3634
signInMethod: GithubAuthProvider.GITHUB_SIGN_IN_METHOD,
@@ -66,9 +64,7 @@ export class GithubAuthProvider extends OAuthProvider {
6664
}
6765

6866
try {
69-
return GithubAuthProvider.credential(
70-
tokenResponse.oauthAccessToken
71-
);
67+
return GithubAuthProvider.credential(tokenResponse.oauthAccessToken);
7268
} catch {
7369
return null;
7470
}

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

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
/**
2+
* @license
3+
* Copyright 2020 Google LLC
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
118
/**
219
* @license
320
* Copyright 2020 Twitter LLC
@@ -17,7 +34,11 @@
1734

1835
import { expect } from 'chai';
1936

20-
import { OperationType, ProviderId, SignInMethod } from '@firebase/auth-types-exp';
37+
import {
38+
OperationType,
39+
ProviderId,
40+
SignInMethod
41+
} from '@firebase/auth-types-exp';
2142

2243
import { TEST_ID_TOKEN_RESPONSE } from '../../../test/helpers/id_token_response';
2344
import { testUser } from '../../../test/helpers/mock_auth';

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

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
/**
2+
* @license
3+
* Copyright 2020 Google LLC
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
118
/**
219
* @license
320
* Copyright 2020 Twitter LLC
@@ -29,15 +46,12 @@ export class TwitterAuthProvider extends OAuthProvider {
2946
static readonly PROVIDER_ID = externs.ProviderId.TWITTER;
3047
readonly providerId = TwitterAuthProvider.PROVIDER_ID;
3148

32-
static credential(
33-
token: string,
34-
secret: string,
35-
): externs.OAuthCredential {
49+
static credential(token: string, secret: string): externs.OAuthCredential {
3650
return OAuthCredential._fromParams({
3751
providerId: TwitterAuthProvider.PROVIDER_ID,
3852
signInMethod: TwitterAuthProvider.TWITTER_SIGN_IN_METHOD,
3953
oauthToken: token,
40-
oauthTokenSecret: secret,
54+
oauthTokenSecret: secret
4155
});
4256
}
4357

@@ -63,16 +77,16 @@ export class TwitterAuthProvider extends OAuthProvider {
6377
if (!tokenResponse) {
6478
return null;
6579
}
66-
const {oauthAccessToken, oauthTokenSecret} = tokenResponse as SignInWithIdpResponse;
80+
const {
81+
oauthAccessToken,
82+
oauthTokenSecret
83+
} = tokenResponse as SignInWithIdpResponse;
6784
if (!oauthAccessToken || !oauthTokenSecret) {
6885
return null;
6986
}
7087

7188
try {
72-
return TwitterAuthProvider.credential(
73-
oauthAccessToken,
74-
oauthTokenSecret
75-
);
89+
return TwitterAuthProvider.credential(oauthAccessToken, oauthTokenSecret);
7690
} catch {
7791
return null;
7892
}

0 commit comments

Comments
 (0)