Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
d792eb9
feat: add identity headers to support banner requests when user is si…
Mar 3, 2026
757303d
Merge branch 'main' into jm/feat-mparticle-headers
juabara Mar 3, 2026
7c3ea21
feat: use getAuthHeaders for support banner requests to include ident…
Mar 3, 2026
0d25675
Merge branch 'jm/feat-mparticle-headers' of github.com:guardian/dotco…
Mar 3, 2026
f92b557
Merge branch 'main' into jm/feat-mparticle-headers
juabara Mar 3, 2026
ae51860
Merge branch 'main' into jm/feat-mparticle-headers
juabara Mar 4, 2026
1c45443
Merge branch 'main' into jm/feat-mparticle-headers
juabara Mar 4, 2026
032f324
feat: mock contributions API in storybook to prevent hanging on conse…
Mar 4, 2026
a0a25b5
chore: remove commented-out alias assignment in Storybook config
Mar 4, 2026
d19eeee
Merge branch 'main' of github.com:guardian/dotcom-rendering into jm/f…
Mar 5, 2026
5dda22e
fix: webpack server build failing due broken parse5 source maps insid…
Mar 5, 2026
42c7887
refactor: update TopBarSupport to use `useAuthStatus`, add a timeout …
Mar 5, 2026
08cbf93
chore: fix empty line lint rule
Mar 5, 2026
854d94b
chore: better naming header variables
Mar 5, 2026
07a6f71
Merge branch 'main' into jm/feat-mparticle-headers
juabara Mar 5, 2026
2c89d8e
fix: missing headers in DecideLayout, Gallery and Sport Data storybooks
Mar 5, 2026
8832f4d
Merge branch 'main' into jm/feat-mparticle-headers
juabara Mar 5, 2026
4d11607
feat: use `useIsSignedIn` hook to determine user sign-in status.
Mar 5, 2026
c0a20e5
Merge branch 'main' into jm/feat-mparticle-headers
juabara Mar 5, 2026
aab700a
Merge branch 'main' into jm/feat-mparticle-headers
juabara Mar 6, 2026
f0befca
Merge branch 'main' into jm/feat-mparticle-headers
juabara Mar 10, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions dotcom-rendering/src/components/TopBarSupport.importable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import { css } from '@emotion/react';
import { getCookie, isUndefined } from '@guardian/libs';
import type { ComponentEvent } from '@guardian/ophan-tracker-js';
import { getHeader } from '@guardian/support-dotcom-components';
import type {
HeaderPayload,
ModuleData,
Expand All @@ -21,8 +20,10 @@ import {
getPurchaseInfo,
shouldHideSupportMessaging,
} from '../lib/contributions';
import { getOptionsHeaders } from '../lib/identity';
import { getHeader } from '../lib/sdcRequests';
import { useBetaAB } from '../lib/useAB';
import { useIsSignedIn } from '../lib/useAuthStatus';
import { useAuthStatus } from '../lib/useAuthStatus';
import { useCountryCode } from '../lib/useCountryCode';
import { usePageViewId } from '../lib/usePageViewId';
import { useConfig } from './ConfigContext';
Expand Down Expand Up @@ -56,7 +57,11 @@ const ReaderRevenueLinksRemote = ({
useState<ModuleData<HeaderProps> | null>(null);
const [SupportHeader, setSupportHeader] =
useState<React.ElementType<HeaderProps> | null>(null);
const isSignedIn = useIsSignedIn();
const authStatus = useAuthStatus();
const isSignedIn =
authStatus.kind === 'Pending'
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems to duplicate what useIsSignedIn does

? 'Pending'
: authStatus.kind === 'SignedIn';

const { renderingTarget } = useConfig();
const abTests = useBetaAB();
Expand Down Expand Up @@ -90,7 +95,12 @@ const ReaderRevenueLinksRemote = ({
},
};

getHeader(contributionsServiceUrl, requestData)
const headers =
authStatus.kind === 'SignedIn'
? getOptionsHeaders(authStatus).headers
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should use getAuthHeaders, which also checks consent.
The useIsSignedIn hook is probably also useful here

: undefined;

getHeader(contributionsServiceUrl, requestData, headers)
.then((response: ModuleDataResponse<HeaderProps>) => {
if (!response.data) {
return null;
Expand Down Expand Up @@ -131,6 +141,7 @@ const ReaderRevenueLinksRemote = ({
pageViewId,
pageUrl,
abTests,
authStatus,
]);

if (SupportHeader !== null && supportHeaderResponse) {
Expand Down
3 changes: 2 additions & 1 deletion dotcom-rendering/src/lib/sdcRequests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,5 +112,6 @@ export const getGutterLiveblog = (
export const getHeader = (
baseUrl: string,
payload: HeaderPayload,
headers?: HeadersInit,
): Promise<ModuleDataResponse<HeaderProps>> =>
getModuleData('header', baseUrl, payload);
getModuleData('header', baseUrl, payload, headers);
Loading