Skip to content

Commit 8972aea

Browse files
committed
Formatting
1 parent 7ef7b24 commit 8972aea

File tree

6 files changed

+23
-15
lines changed

6 files changed

+23
-15
lines changed

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

+5-5
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ use(chaiAsPromised);
2626

2727
describe('core/providers/anonymous', () => {
2828
let auth: Auth;
29-
29+
3030
beforeEach(async () => {
3131
auth = await testAuth();
3232
});
33-
33+
3434
describe('AnonymousCredential', () => {
3535
const credential = new AnonymousCredential();
3636

@@ -50,9 +50,9 @@ describe('core/providers/anonymous', () => {
5050

5151
describe('#_getIdTokenResponse', () => {
5252
it('throws', async () => {
53-
await expect(
54-
credential._getIdTokenResponse(auth)
55-
).to.be.rejectedWith(Error);
53+
await expect(credential._getIdTokenResponse(auth)).to.be.rejectedWith(
54+
Error
55+
);
5656
});
5757
});
5858

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

+7-2
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,15 @@
1515
* limitations under the License.
1616
*/
1717

18-
import { AuthCredential, ProviderId, SignInMethod, AuthProvider } from "@firebase/auth-types-exp";
18+
import {
19+
AuthCredential,
20+
ProviderId,
21+
SignInMethod,
22+
AuthProvider
23+
} from '@firebase/auth-types-exp';
1924
import { signUp } from '../../api/authentication/sign_up';
2025
import { Auth } from '../../model/auth';
21-
import { IdTokenResponse } from "../../model/id_token";
26+
import { IdTokenResponse } from '../../model/id_token';
2227
import { debugFail } from '../util/assert';
2328

2429
export class AnonymousCredential implements AuthCredential {

packages-exp/auth-exp/src/core/strategies/anonymous.test.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ describe('core/strategies/anonymous', () => {
3434
const serverUser: APIUserInfo = {
3535
localId: 'local-id'
3636
};
37-
37+
3838
beforeEach(async () => {
3939
auth = await testAuth();
4040
mockFetch.setUp();
@@ -52,9 +52,7 @@ describe('core/strategies/anonymous', () => {
5252

5353
describe('signInAnonymously', () => {
5454
it('should sign in an anonymous user', async () => {
55-
const { credential, user, operationType } = await signInAnonymously(
56-
auth
57-
);
55+
const { credential, user, operationType } = await signInAnonymously(auth);
5856
expect(credential?.providerId).to.eq(ProviderId.ANONYMOUS);
5957
expect(credential?.signInMethod).to.eq(SignInMethod.ANONYMOUS);
6058
expect(operationType).to.eq(OperationType.SIGN_IN);

packages-exp/auth-exp/src/core/strategies/anonymous.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ import { AnonymousProvider } from '../providers/anonymous';
2121
import { UserCredentialImpl } from '../user/user_credential_impl';
2222
import { signInWithCredential } from './credential';
2323

24-
export async function signInAnonymously(externAuth: externs.Auth): Promise<externs.UserCredential> {
24+
export async function signInAnonymously(
25+
externAuth: externs.Auth
26+
): Promise<externs.UserCredential> {
2527
const auth = externAuth as Auth;
2628
const credential = AnonymousProvider.credential();
2729
if (auth.currentUser?.isAnonymous) {
@@ -34,4 +36,3 @@ export async function signInAnonymously(externAuth: externs.Auth): Promise<exter
3436
}
3537
return signInWithCredential(auth, credential);
3638
}
37-

packages-exp/auth-exp/src/core/user/user_credential_impl.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,11 @@ export class UserCredentialImpl implements UserCredential {
3636
operationType: externs.OperationType,
3737
idTokenResponse: IdTokenResponse
3838
): Promise<UserCredential> {
39-
const user = await UserImpl._fromIdTokenResponse(auth, idTokenResponse, credential?.providerId === externs.ProviderId.ANONYMOUS);
39+
const user = await UserImpl._fromIdTokenResponse(
40+
auth,
41+
idTokenResponse,
42+
credential?.providerId === externs.ProviderId.ANONYMOUS
43+
);
4044
const userCred = new UserCredentialImpl(user, credential, operationType);
4145
// TODO: handle additional user info
4246
// updateAdditionalUserInfoFromIdTokenResponse(userCred, idTokenResponse);

packages-exp/auth-exp/src/core/user/user_impl.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export class UserImpl implements User {
6666
phoneNumber: string | null;
6767
photoURL: string | null;
6868
isAnonymous: boolean = false;
69-
69+
7070
constructor({ uid, auth, stsTokenManager, ...opt }: UserParameters) {
7171
this.uid = uid;
7272
this.auth = auth;

0 commit comments

Comments
 (0)