Skip to content

Commit 51ff055

Browse files
committed
test notifiers also without a provided URL
1 parent 1a50eaa commit 51ff055

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/device-login.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,8 @@ export class DeviceLogin {
145145
pendingRedirects.set(reqId, this.onTestVisit(resolve, reject).bind(this));
146146
}),
147147
),
148-
await this.notify(NotificationReason.TEST, url),
148+
await this.notify(NotificationReason.TEST_WITH_URL, url),
149+
await this.notify(NotificationReason.TEST_WITHOUT_URL),
149150
]);
150151
pendingRedirects.delete(reqId);
151152
}
@@ -175,10 +176,9 @@ export class DeviceLogin {
175176
private async notify(reason: NotificationReason, inUrl?: string): Promise<void> {
176177
let url: string | undefined;
177178
if (inUrl) {
179+
url = inUrl;
178180
if (config.webPortalConfig?.localtunnel) {
179181
url = await getLocaltunnelUrl(inUrl);
180-
} else {
181-
url = inUrl;
182182
}
183183
}
184184
this.L.info({ reason, url }, 'Dispatching notification');

src/interfaces/notification-reason.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ export enum NotificationReason {
22
LOGIN = 'LOGIN',
33
PURCHASE = 'PURCHASE',
44
CREATE_ACCOUNT = 'CREATE_ACCOUNT',
5-
TEST = 'TEST',
5+
TEST_WITH_URL = 'TEST_WITH_URL',
6+
TEST_WITHOUT_URL = 'TEST_WITHOUT_URL',
67
PURCHASE_ERROR = 'PURCHASE ERROR',
78
}

0 commit comments

Comments
 (0)