add distinct ID to session info, add logic for /undefined

This commit is contained in:
Francis Cao 2025-04-29 15:26:08 -07:00
parent b3e1aef4ef
commit f522db44f9
5 changed files with 389 additions and 6 deletions

View file

@ -18,7 +18,8 @@ export default function SessionInfo({ data }) {
<dd>
{data?.id} <CopyIcon value={data?.id} />
</dd>
<dt>{formatMessage(labels.distinctId)}</dt>
<dd>{data?.distinctId}</dd>
<dt>{formatMessage(labels.lastSeen)}</dt>
<dd>{formatTimezoneDate(data?.lastAt, 'PPPPpp')}</dd>

View file

@ -145,7 +145,7 @@ export async function POST(request: Request) {
const base = hostname ? `https://${hostname}` : 'https://localhost';
const currentUrl = new URL(url, base);
let urlPath = currentUrl.pathname;
let urlPath = currentUrl.pathname === '/undefined' ? '' : currentUrl.pathname;
const urlQuery = currentUrl.search.substring(1);
const urlDomain = currentUrl.hostname.replace(/^www./, '');