Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions e2e/thunder-config/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ tls:
key_file: "repository/resources/security/server.key"

database:
identity:
config:
type: "sqlite"
path: "repository/database/thunderdb.db"
path: "repository/database/config.db"
options: "_journal_mode=WAL&_busy_timeout=5000&_pragma=foreign_keys(1)"
max_open_conns: 500
max_idle_conns: 100
Expand Down
4 changes: 2 additions & 2 deletions packages/javascript/src/models/v2/embedded-flow-v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -504,10 +504,10 @@ export interface ConsentPurposeData {
essential: string[];
/** Attributes that the user can optionally decline */
optional: string[];
/** Unique identifier for the purpose */
purposeId: string;
/** Human-readable purpose name */
purposeName?: string;
/** Unique identifier for the purpose */
purpose_id: string;
}

/**
Expand Down
6 changes: 3 additions & 3 deletions packages/react/src/components/adapters/Consent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export interface ConsentProps {
* <Consent consentData={raw} formValues={formInputs} onInputChange={onChange} t={t}>
* {({ purposes, formValues, onInputChange, t }) => (
* <div>
* {purposes.map(p => <MyConsentSection key={p.purpose_id} purpose={p} />)}
* {purposes.map(p => <MyConsentSection key={p.purposeId} purpose={p} />)}
* </div>
* )}
* </Consent>
Expand Down Expand Up @@ -104,10 +104,10 @@ const Consent: FC<ConsentProps> = ({consentData, formValues, onInputChange, chil
return (
<div style={{display: 'flex', flexDirection: 'column', gap: '1rem', marginTop: '0.25rem'}}>
{purposes.map((purpose: ConsentPurposeData, purposeIndex: number) => (
<div key={purpose.purpose_id || purposeIndex} style={{paddingBottom: '1rem'}}>
<div key={purpose.purposeId || purposeIndex} style={{paddingBottom: '1rem'}}>
{/* TODO: Uncomment when the backend supports multiple purposes for a application */}
{/* <Typography variant="h6" fontWeight={600} gutterBottom color="inherit">
{purpose.purpose_name}
{purpose.purposeName}
</Typography>
<Typography variant="body2" color="inherit" style={{marginBottom: '1rem', opacity: 0.85}}>
{purpose.description}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,13 @@ const ConsentCheckboxList: FC<ConsentCheckboxListProps> = ({
if (isEssential) {
return true;
}
const key: string = getConsentOptionalKey(purpose.purpose_id, attrName);
const key: string = getConsentOptionalKey(purpose.purposeId, attrName);
// Default to opted-in (true) when there's no explicit form value
return formValues[key] !== 'false';
};

const handleChange = (attrName: string, checked: boolean): void => {
const key: string = getConsentOptionalKey(purpose.purpose_id, attrName);
const key: string = getConsentOptionalKey(purpose.purposeId, attrName);
onInputChange(key, checked ? 'true' : 'false');
};

Expand All @@ -142,7 +142,7 @@ const ConsentCheckboxList: FC<ConsentCheckboxListProps> = ({
return (
<div className={cx(withVendorCSSClassPrefix(bem('consent-checkbox-list')), styles['listContainer'])}>
{attributes.map((attr: string) => {
const inputId: string = `consent_${isEssential ? 'ess' : 'opt'}_${purpose.purpose_id}_${attr}`;
const inputId: string = `consent_${isEssential ? 'ess' : 'opt'}_${purpose.purposeId}_${attr}`;
const checked: boolean = isChecked(attr);

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,12 +271,12 @@ const createAuthComponentFromFlow = (
...p.essential.map((attr: string): ConsentAttributeElement => ({approved: !isDeny, name: attr})),
...p.optional.map(
(attr: string): ConsentAttributeElement => ({
approved: isDeny ? false : formValues[getConsentOptionalKey(p.purpose_id, attr)] !== 'false',
approved: isDeny ? false : formValues[getConsentOptionalKey(p.purposeId, attr)] !== 'false',
name: attr,
}),
),
],
purposeName: (p as any).purposeName ?? (p as any).purpose_name,
purposeName: p.purposeName,
}),
),
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -564,14 +564,14 @@ const SignIn: FC<SignInProps> = ({
name: attr,
})),
...(p.optional || []).map((attr: string) => {
const key: string = `__consent_opt__${p.purpose_id}__${attr}`;
const key: string = `__consent_opt__${p.purposeId}__${attr}`;
return {
approved: isDeny ? false : processedInputs[key] !== 'false',
name: attr,
};
}),
],
purposeName: (p as any).purposeName ?? (p as any).purpose_name,
purposeName: p.purposeName,
})),
};
processedInputs['consent_decisions'] = JSON.stringify(decisions);
Expand Down
Loading