amplify-cli icon indicating copy to clipboard operation
amplify-cli copied to clipboard

remove dependencies on `amplify remove auth`, support re-creating auth flow

Open matansagee opened this issue 4 years ago • 3 comments

Note: If your question is regarding the AWS Amplify Console service, please log in the AWS Amplify Console repository My current auth support only signs in with email. I wish to sign in with SMS and by email. To do that, I understand that I need to recreate the auth flow. However, I'm unable to remove the auth because of dependencies.

Would love to understand what should I do. Thanks!

Which Category is your question related to? Auth

Amplify CLI Version

You can use amplify -v to check the amplify CLI version on your system 5.1.1

What AWS Services are you utilizing? Auth

Provide additional details e.g. code snippets image

matansagee avatar Jul 30 '21 00:07 matansagee

You may need to ampify update api to remove the dependencies before removing auth, then set them back again after.

johnpc avatar Jul 30 '21 17:07 johnpc

Thanks, @johnpc ! I use a lot of APIs and functions, all of them are using authentication. I'm guessing I will need to remove the authentication from all of them before removing the authentication, right?

Moreover, I have multiple environments (dev, production 1, production 2). What will happen if I do all the changes in my dev environment, then create a new authentication in the dev environment, and then deploy it to my production environments?

Will it finish successfully in one merge from one environment to the other?

Thanks! Matan

matansagee avatar Jul 31 '21 17:07 matansagee

Unfortunately, it looks like this could be some messy manual work. I don't like this answer, but right now the only way is to remove auth from every resource in every environment, then delete the auth, then re-add auth to each resource then push.

I'm going to mark this as a feature request to improve this process - it should be possible from the cli.

johnpc avatar Aug 02 '21 16:08 johnpc

You may need to ampify update api to remove the dependencies before removing auth, then set them back again after.

Hello, I do not see a way to remove auth from api with amplify update api (I'm using GraphQL) It looks like I con only add/change auth.

Can you explain how to accomplish this? Thank you.

andreav avatar Dec 24 '22 10:12 andreav