ymaghzaz / aws-amplify-react-custom-ui Goto Github PK
View Code? Open in Web Editor NEWBuilding a Custom UI Authentication For AWS Amplify
Building a Custom UI Authentication For AWS Amplify
Hi,
First, thanks a lot for your work on this package !
I wanted to migrate to @aws-amplify/ui-react as explained here :
https://docs.amplify.aws/ui/auth/authenticator/q/framework/react#migration
but it doesn't seems to be compatible.
I changed import * as aws_amplify_react from 'aws-amplify-react' to import * as aws_amplify_react from '@aws-amplify/ui-react' but I now get an error : "Uncaught please provide a valid component"
Can we please remove console.log("costumUiLocal", costumUiLocal);
so that it won't mess console logs.
First of all, thanks for such a great package, the UI is looking great thanks to this customisation.
I have created 2 class components, one for SigIn
, another for NewPassword
, i.e. overriding the auto-generated password when an admin creates a new account in Cognito.
The components are successfully loaded like this
AmplifyCustomUi.setSignIn(SignIn);
AmplifyCustomUi.setRequireNewPassword(NewPassword);
The SignIn
component is able to create a Cognito session and returns the payload in the user
result object.
const user = await Auth.signIn(username, password);
if (!user.challengeName) {
this.changeState("signedIn", user);
return true;
}
if (user.challengeName === "NEW_PASSWORD_REQUIRED") {
this.changeState("requireNewPassword", user);
}
return false;
The problem is that the NewPassword
component does not receive the user
content via props.
Could you provide an example of how could I retrieve the user, so that I can invoke the following Amplify function to set the initial password?
const result = await Auth.completeNewPassword(user, password, {});
thanks very much,
Jaume
Hello. I am using your library to create a custom ConfirmSignUp. It works great for SignIn and SignUp but when I want to confirm the Sign Up it renders a blank page, and if I refresh it takes me back to sign in.
Here is my function :
onSubmit = (event) => {
const { username, verificationCode } = this.state;
Auth.confirmSignUp(username, verificationCode)
.then((user) => {
this.changeState("signedUp", user);
})
.catch(err => {
this.setState(updateByPropertyName("error", err));
});
event.preventDefault();
};
Thank you
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.