The API endpoint URL to check
True if the endpoint requires authentication
if (isAuthRequiredEndpoint('/api/center/order_list')) {
// Add authentication headers
}
export function isAuthRequiredEndpoint(url: string): boolean {
// TS narrows enum-value arrays to the enum union; widen to string[] so
// .includes accepts an arbitrary string argument.
return (Object.values(AuthRequiredEndpoints) as string[]).includes(url);
}
Validates if a URL requires authentication. These endpoints require a valid user token in the X-User-Token header.