aws-amplify / aws-amplify/amplify-cli

Auth sign-in redirect Url get carried through different environments

Open
#11,818 6 comments 5 reactions 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?

yarn

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

18.11.0

### Amplify CLI Version

10.6.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

I currently have two working environments (dev and staging) for my project and I am using Google Oauth provider for both of them.

The problem is that the sign-in redirect URL for one environment will get carried over when switching between the environments.

### Expected behavior

I need the following sign-in redirect URLs for each environment:

**dev**: https://dev.mydomain.com/, http://localhost:3000/
**staging**: https://staging.mydomain.com/

### Reproduction steps

1. When adding a new environment, sign-in redirect URLs are copied to the new environment: `amplify add env`
2. Switch to the new environment: `amplify checkout env staging`
3. Update auth with new sign-in redirect URL: `amplify update auth` - `Add/Edit signin and signout redirect URIs`
4. Push new configuration to the cloud: `amplify push`

* At this point, the sign-in redirect URLs for both `dev` and `staging` are correctly configured on cloud

5. Switch to the original dev environment: `amplify checkout env dev`
6. Amplify detects the change to the auth made to the staging environment: `amplify status`
7. The sign-in redirect URL for staging is pushed to the cloud for dev environment: `amplify push`

* Now the sign-in redirect URL for both `dev` and `staging` are incorrectly configured to be `https://staging.mydomain.com/`

### Project Identifier

_No response_

### Log output

```
# Put your logs below this line

```

### 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

Research direction

Start with the amplify add env, checkout env, update auth, status, and push workflow described in the reproduction steps, using the listed dev and staging redirect URLs. Trace how auth configuration is copied and detected when environments are switched; done means pushing dev no longer carries staging's sign-in redirect URL into the dev environment.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
authentication, cli, cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.