Skip to content

Commit 9150830

Browse files
authored
fix: use enterprise token if hostname of notification is enterprise server (#669)
1 parent 25ac94a commit 9150830

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/hooks/useNotifications.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,21 @@ export const useNotifications = (colors: boolean): NotificationsState => {
124124
) {
125125
return notification;
126126
}
127+
const isEnterprise =
128+
accountNotifications.hostname !==
129+
Constants.DEFAULT_AUTH_OPTIONS.hostname;
130+
const token = isEnterprise
131+
? getEnterpriseAccountToken(
132+
accountNotifications.hostname,
133+
accounts.enterpriseAccounts,
134+
)
135+
: accounts.token;
127136

128137
const cardinalData = (
129138
await apiRequestAuth(
130139
notification.subject.url,
131140
'GET',
132-
accounts.token,
141+
token,
133142
)
134143
).data;
135144

0 commit comments

Comments
 (0)