Skip to content

Commit 4ffbce6

Browse files
committed
PR feedback
1 parent babb14a commit 4ffbce6

File tree

3 files changed

+6
-14
lines changed

3 files changed

+6
-14
lines changed

packages-exp/auth-exp/src/core/auth/auth_event_manager.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,7 @@
1616
*/
1717

1818
import {
19-
AuthEvent,
20-
AuthEventConsumer,
21-
AuthEventType,
22-
EventManager
19+
AuthEvent, AuthEventConsumer, AuthEventType, EventManager
2320
} from '../../model/popup_redirect';
2421
import { AUTH_ERROR_FACTORY, AuthErrorCode } from '../errors';
2522

@@ -81,7 +78,6 @@ export class AuthEventManager implements EventManager {
8178

8279
private sendToConsumer(event: AuthEvent, consumer: AuthEventConsumer): void {
8380
if (event.error) {
84-
console.error('ERROR');
8581
const code =
8682
(event.error.code?.split('auth/')[1] as AuthErrorCode) ||
8783
AuthErrorCode.INTERNAL_ERROR;

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,10 @@
1818
import * as externs from '@firebase/auth-types-exp';
1919

2020
import { Auth } from '../../model/auth';
21-
import {
22-
AuthEventType,
23-
PopupRedirectResolver
24-
} from '../../model/popup_redirect';
21+
import { AuthEventType, PopupRedirectResolver } from '../../model/popup_redirect';
2522
import { User } from '../../model/user';
2623
import { AUTH_ERROR_FACTORY, AuthErrorCode } from '../errors';
24+
import { debugAssert } from '../util/assert';
2725
import { Delay } from '../util/delay';
2826
import { _generateEventId } from '../util/event_id';
2927
import { _getInstance } from '../util/instantiator';
@@ -114,6 +112,7 @@ class PopupOperation extends AbstractPopupRedirectOperation {
114112
}
115113

116114
async onExecution(): Promise<void> {
115+
debugAssert(this.filter.length === 1, 'Popup operations only handle one event');
117116
const eventId = _generateEventId();
118117
this.authWindow = await this.resolver._openPopup(
119118
this.auth,

packages-exp/auth-exp/src/platform_browser/popup_redirect.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,7 @@ import { _getCurrentUrl } from '../core/util/location';
2828
import { _open, AuthPopup } from '../core/util/popup';
2929
import { ApiKey, AppName, Auth } from '../model/auth';
3030
import {
31-
AuthEventType,
32-
EventManager,
33-
GapiAuthEvent,
34-
GapiOutcome,
35-
PopupRedirectResolver
31+
AuthEventType, EventManager, GapiAuthEvent, GapiOutcome, PopupRedirectResolver
3632
} from '../model/popup_redirect';
3733
import { _setWindowLocation } from './auth_window';
3834
import { _openIframe } from './iframe/iframe';
@@ -90,6 +86,7 @@ class BrowserPopupRedirectResolver implements PopupRedirectResolver {
9086
iframe.register<GapiAuthEvent>(
9187
'authEvent',
9288
({ authEvent }: GapiAuthEvent) => {
89+
// TODO: Consider splitting redirect and popup events earlier on
9390
const handled = eventManager.onEvent(authEvent);
9491
return { status: handled ? GapiOutcome.ACK : GapiOutcome.ERROR };
9592
},

0 commit comments

Comments
 (0)