Skip to content

Commit

Permalink
fix: use enterprise token if hostname of notification is enterprise s…
Browse files Browse the repository at this point in the history
…erver (#669)
  • Loading branch information
p1ass committed Oct 18, 2023
1 parent 25ac94a commit 9150830
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/hooks/useNotifications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,21 @@ export const useNotifications = (colors: boolean): NotificationsState => {
) {
return notification;
}
const isEnterprise =
accountNotifications.hostname !==
Constants.DEFAULT_AUTH_OPTIONS.hostname;
const token = isEnterprise
? getEnterpriseAccountToken(
accountNotifications.hostname,
accounts.enterpriseAccounts,
)
: accounts.token;

const cardinalData = (
await apiRequestAuth(
notification.subject.url,
'GET',
accounts.token,
token,
)
).data;

Expand Down

0 comments on commit 9150830

Please sign in to comment.