aws-amplify / aws-amplify/amplify-cli

Wrong setting when using custom domain

Open
#11,706 19 comments 1 reaction 0 assignees View on GitHub
auth feature-request p3
Dominant language
TypeScript
Stars
2.9k
Forks
825
Avg merge
11d 23h
Merged PRs (30d)
2

Description

### How did you install the Amplify CLI?

npm

### If applicable, what version of Node.js are you using?

v18.2.0

### Amplify CLI Version

10.5.2

### What operating system are you using?

Mac

### Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.

No manual changes made

### Describe the bug

If you provide a custom auth.mydomain.com for OAuth in cognito, every time you run amplify push it overwrites aws-exports.js and changes:

`oauth: {
domain: auth.mydomain.com --> gets changed to . "appname-env.auth.region.amazoncognito.com"
}`

https://github.com/aws-amplify/amplify-cli/blob/06300cc1444bf6e018cc50e18f9cce1967e00426/packages/amplify-frontend-javascript/lib/frontend-config-creator.js#L359-L362

### Expected behavior

If a custom domain name is used, '.auth.region.amazoncognito.com' should not be added to the end.

### Reproduction steps

1. An existing cognito for amplify auth is integrated
2. Added custom domain for Cognito
3. Changes are pulled locally or pipeline is triggered
4. 'auth.domain' appears incorrectly in aws-exports.json

### Project Identifier

77facb24fcba8c9dee551c27006d6b76

### Log output

_No response_

### Additional information

_No response_

### Before submitting, please confirm:

- [X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
- [X] I have removed any sensitive information from my code snippets and submission.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.