Skip to content

Commit 07adffb

Browse files
author
Vieltojarvi
committed
Merge branch 'main' into seed-feat
2 parents 55a5253 + b7f6719 commit 07adffb

File tree

7 files changed

+445
-360
lines changed

7 files changed

+445
-360
lines changed

.changeset/lazy-words-invite.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@aws-amplify/backend-cli': patch
3+
---
4+
5+
Cache dependencies when assessing notices predicates

.changeset/loud-teams-wink.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@aws-amplify/auth-construct': patch
3+
---
4+
5+
Modified the AmplifyAuth class in packages/auth-construct/src/construct.ts to explicitly set the userPoolName property to match the construct's name property

.github/workflows/health_checks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,7 @@ jobs:
599599
- os: macos-14
600600
node-version: 20
601601
- os: windows-latest
602-
node-version: 20
602+
node-version: 18
603603
- os: macos-14
604604
node-version: 22
605605
- os: windows-latest

packages/auth-construct/src/construct.test.ts

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { beforeEach, describe, it, mock } from 'node:test';
22
import { AmplifyAuth } from './construct.js';
33
import { App, SecretValue, Stack, aws_cognito } from 'aws-cdk-lib';
4-
import { Template } from 'aws-cdk-lib/assertions';
4+
import { Match, Template } from 'aws-cdk-lib/assertions';
55
import assert from 'node:assert';
66
import {
77
BackendOutputEntry,
@@ -3062,4 +3062,30 @@ void describe('Auth construct', () => {
30623062
assert.equal(name.startsWith(expectedPrefix), true);
30633063
});
30643064
});
3065+
3066+
void it('sets the correct userPoolName when name is provided', () => {
3067+
const app = new App();
3068+
const stack = new Stack(app);
3069+
const customAuthName = 'CustomAuthName';
3070+
new AmplifyAuth(stack, 'test', {
3071+
loginWith: { email: true },
3072+
name: customAuthName,
3073+
});
3074+
const template = Template.fromStack(stack);
3075+
template.hasResourceProperties('AWS::Cognito::UserPool', {
3076+
UserPoolName: customAuthName,
3077+
});
3078+
});
3079+
3080+
void it('uses empty string as userPoolName when name is not provided', () => {
3081+
const app = new App();
3082+
const stack = new Stack(app);
3083+
new AmplifyAuth(stack, 'test', {
3084+
loginWith: { email: true },
3085+
});
3086+
const template = Template.fromStack(stack);
3087+
template.hasResourceProperties('AWS::Cognito::UserPool', {
3088+
UserPoolName: Match.absent(),
3089+
});
3090+
});
30653091
});

packages/auth-construct/src/construct.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -630,6 +630,7 @@ export class AmplifyAuth
630630
)
631631
: undefined,
632632
customSenderKmsKey: this.customSenderKMSkey,
633+
userPoolName: props.name || undefined,
633634
};
634635
return userPoolProps;
635636
};

0 commit comments

Comments
 (0)