Skip to content

Commit

Permalink
test notifiers also without a provided URL
Browse files Browse the repository at this point in the history
  • Loading branch information
laur89 committed Feb 6, 2025
1 parent 1a50eaa commit abe0c6b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/device-login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ export class DeviceLogin {
pendingRedirects.set(reqId, this.onTestVisit(resolve, reject).bind(this));
}),
),
await this.notify(NotificationReason.TEST, url),
await this.notify(NotificationReason.TEST_WITH_URL, url),
await this.notify(NotificationReason.TEST_WITHOUT_URL),
]);
pendingRedirects.delete(reqId);
}
Expand Down Expand Up @@ -175,10 +176,9 @@ export class DeviceLogin {
private async notify(reason: NotificationReason, inUrl?: string): Promise<void> {
let url: string | undefined;
if (inUrl) {
url = inUrl;
if (config.webPortalConfig?.localtunnel) {
url = await getLocaltunnelUrl(inUrl);
} else {
url = inUrl;
}
}
this.L.info({ reason, url }, 'Dispatching notification');
Expand Down
3 changes: 2 additions & 1 deletion src/interfaces/notification-reason.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ export enum NotificationReason {
LOGIN = 'LOGIN',
PURCHASE = 'PURCHASE',
CREATE_ACCOUNT = 'CREATE_ACCOUNT',
TEST = 'TEST',
TEST_WITH_URL = 'TEST_WITH_URL',
TEST_WITHOUT_URL = 'TEST_WITHOUT_URL',
PURCHASE_ERROR = 'PURCHASE ERROR',
}

0 comments on commit abe0c6b

Please sign in to comment.