Skip to content

Commit 7fbff7d

Browse files
committed
Formatting
1 parent cf3bc66 commit 7fbff7d

File tree

3 files changed

+16
-21
lines changed

3 files changed

+16
-21
lines changed

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,10 @@ describe('auth compat', () => {
6363
);
6464
providerStub.isInitialized.returns(true);
6565
providerStub.getImmediate.returns(underlyingAuth);
66-
const authCompat = new Auth(app, providerStub as unknown as Provider<'auth-exp'>);
66+
const authCompat = new Auth(
67+
app,
68+
(providerStub as unknown) as Provider<'auth-exp'>
69+
);
6770
// eslint-disable-next-line @typescript-eslint/no-floating-promises
6871
await authCompat.signInWithRedirect(new exp.GoogleAuthProvider());
6972
expect(
@@ -80,17 +83,15 @@ describe('auth compat', () => {
8083
);
8184
providerStub.isInitialized.returns(false);
8285
providerStub.initialize.returns(underlyingAuth);
83-
new Auth(app, providerStub as unknown as Provider<'auth-exp'>);
86+
new Auth(app, (providerStub as unknown) as Provider<'auth-exp'>);
8487
// eslint-disable-next-line @typescript-eslint/no-floating-promises
85-
expect(
86-
providerStub.initialize
87-
).to.have.been.calledWith({
88+
expect(providerStub.initialize).to.have.been.calledWith({
8889
options: {
8990
popupRedirectResolver: CompatPopupRedirectResolver,
9091
persistence: [
9192
exp.inMemoryPersistence,
9293
exp.indexedDBLocalPersistence,
93-
exp.browserLocalPersistence,
94+
exp.browserLocalPersistence
9495
]
9596
}
9697
});

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

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,7 @@ import { FirebaseApp, _FirebaseService } from '@firebase/app-compat';
1919
import * as exp from '@firebase/auth-exp/internal';
2020
import * as compat from '@firebase/auth-types';
2121
import { Provider } from '@firebase/component';
22-
import {
23-
ErrorFn,
24-
Observer,
25-
Unsubscribe
26-
} from '@firebase/util';
22+
import { ErrorFn, Observer, Unsubscribe } from '@firebase/util';
2723

2824
import {
2925
_validatePersistenceArgument,
@@ -88,10 +84,12 @@ export class Auth
8884
// Only use a popup/redirect resolver in browser environments
8985
const resolver =
9086
typeof window !== 'undefined' ? CompatPopupRedirectResolver : undefined;
91-
this.auth = provider.initialize({ options: {
92-
persistence: persistences,
93-
popupRedirectResolver: resolver,
94-
} }) as exp.AuthImpl;
87+
this.auth = provider.initialize({
88+
options: {
89+
persistence: persistences,
90+
popupRedirectResolver: resolver
91+
}
92+
}) as exp.AuthImpl;
9593

9694
this.auth._updateErrorMap(exp.debugErrorMap);
9795
}

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,18 +98,14 @@ export async function _savePersistenceForRedirect(
9898

9999
export function _getPersistencesFromRedirect(
100100
apiKey: string,
101-
appName: string,
101+
appName: string
102102
): exp.Persistence[] {
103103
const win = getSelfWindow();
104104
if (!win?.sessionStorage) {
105105
return [];
106106
}
107107

108-
const key = exp._persistenceKeyName(
109-
PERSISTENCE_KEY,
110-
apiKey,
111-
appName
112-
);
108+
const key = exp._persistenceKeyName(PERSISTENCE_KEY, apiKey, appName);
113109
const persistence = win.sessionStorage.getItem(key);
114110

115111
switch (persistence) {

0 commit comments

Comments
 (0)