Skip to content

Commit 7c6ce03

Browse files
committed
change custom attr name, unsure why its suddenly rejecting colons
1 parent 4691055 commit 7c6ce03

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

infrastructure/terraform/components/sandbox/aws_cognito_user_pool_sandbox.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ resource "aws_cognito_user_pool" "sandbox" {
99
}
1010

1111
schema {
12-
name = "sbx:client_id"
12+
name = "sbx_client_id"
1313
attribute_data_type = "String"
1414
mutable = true
1515
required = false

lambdas/cognito-triggers/src/__tests__/pre-token-generation.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ const eventWithCustomAttr = (): PreTokenGenerationV2Event => ({
5959
6060
email_verified: 'True',
6161
sub: '76c25234-b041-70f2-8ba4-caf538363b35',
62-
'custom:sbx:client_id': 'f58d4b65-870c-42c0-8bb6-2941c5be2bec',
62+
'custom:sbx_client_id': 'f58d4b65-870c-42c0-8bb6-2941c5be2bec',
6363
},
6464
},
6565
response: {
@@ -71,7 +71,7 @@ const eventWithCustomAttr = (): PreTokenGenerationV2Event => ({
7171
version: '2',
7272
});
7373

74-
describe('when user has custom:sbx:client_id attribute', () => {
74+
describe('when user has custom:sbx_client_id attribute', () => {
7575
test('adds nhs-notify:client-id claim from custom attribute in event', async () => {
7676
const result = await new PreTokenGenerationLambda().handler(
7777
eventWithCustomAttr()

lambdas/cognito-triggers/src/pre-token-generation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export type PreTokenGenerationV2Event = Omit<
2121
export class PreTokenGenerationLambda {
2222
handler = async (event: PreTokenGenerationV2Event) => {
2323
let response = { ...event };
24-
const clientId = event.request.userAttributes['custom:sbx:client_id'];
24+
const clientId = event.request.userAttributes['custom:sbx_client_id'];
2525

2626
if (clientId) {
2727
response = PreTokenGenerationLambda.setTokenClaims(

tests/accessibility/test-user-client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export class TestUserClient {
2727
Value: 'true',
2828
},
2929
{
30-
Name: 'custom:sbx:client_id',
30+
Name: 'custom:sbx_client_id',
3131
Value: clientId,
3232
},
3333
],

tests/test-team/helpers/auth/cognito-auth-helper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ export class CognitoAuthHelper {
178178
const clientAttribute = userDetails.clientId
179179
? [
180180
{
181-
Name: 'custom:sbx:client_id',
181+
Name: 'custom:sbx_client_id',
182182
Value: userDetails.clientId,
183183
},
184184
]

0 commit comments

Comments
 (0)