diff --git a/docs/src/pages/[platform]/connected-components/authenticator/customization/customization.override-function-calls.react-native.mdx b/docs/src/pages/[platform]/connected-components/authenticator/customization/customization.override-function-calls.react-native.mdx index d70d27497e..f4db4438ec 100644 --- a/docs/src/pages/[platform]/connected-components/authenticator/customization/customization.override-function-calls.react-native.mdx +++ b/docs/src/pages/[platform]/connected-components/authenticator/customization/customization.override-function-calls.react-native.mdx @@ -4,7 +4,7 @@ import { TableCell, TableBody, TableHead, TableRow, Alert } from '@aws-amplify/u ## Override Function Calls -You can override the call to `signUp`, `signIn`, `confirmSignIn`, `confirmSignUp`, `forgotPassword` and `forgotPasswordSubmit` functions. +You can override the call to `signUp`, `signIn`, `confirmSignIn`, `confirmSignUp`, `resetPassword` and `confirmResetPassword` functions. To override a call you must create a new `services` object with an `async` `handle*` function that returns an `aws-amplify` `Auth.*` promise. The service object must then be passed into the `authenticator` component as a `services` prop. For example, let's imagine you'd like to lowercase the `username` and the `email` attributes during `signUp`. @@ -20,7 +20,7 @@ This would be overriden like so: -Each `handle*` function will return the neccessary values you'll need to make the call to the `Auth.*` function call. Here is a table of each override function name, and the values returned from `formData`. +Each `handle*` function will return the neccessary values you'll need to make the call to the `Auth` function call. Here is a table of each override function name, and the values returned from `formData`. @@ -31,32 +31,38 @@ Each `handle*` function will return the neccessary values you'll need to make th - `Auth.signUp` + `signUp` + `Auth.signUp` `handleSignUp` `{username, password, attributes }` - `Auth.signIn` + `signIn` + `Auth.signIn` `handleSignIn` `{username, password}` - `Auth.confirmSignIn` + `confirmSignIn` + `Auth.confirmSignIn` `handleConfirmSignIn` `{user, code, mfaType}` - `Auth.confirmSignUp` + `confirmSignUp` + `Auth.confirmSignUp` `handleConfirmSignUp` `{username, code}` - `Auth.forgotPassword` + `resetPassword` + `Auth.forgotPassword` `handleForgotPassword` `{username}` - `Auth.forgotPasswordSubmit` + `confirmResetPassword` + `Auth.forgotPasswordSubmit` `handleForgotPasswordSubmit` `{username, code, password}` diff --git a/docs/src/pages/[platform]/connected-components/authenticator/customization/customization.override-function-calls.web.mdx b/docs/src/pages/[platform]/connected-components/authenticator/customization/customization.override-function-calls.web.mdx index d70d27497e..71e8126757 100644 --- a/docs/src/pages/[platform]/connected-components/authenticator/customization/customization.override-function-calls.web.mdx +++ b/docs/src/pages/[platform]/connected-components/authenticator/customization/customization.override-function-calls.web.mdx @@ -4,7 +4,7 @@ import { TableCell, TableBody, TableHead, TableRow, Alert } from '@aws-amplify/u ## Override Function Calls -You can override the call to `signUp`, `signIn`, `confirmSignIn`, `confirmSignUp`, `forgotPassword` and `forgotPasswordSubmit` functions. +You can override the call to `signUp`, `signIn`, `confirmSignIn`, `confirmSignUp`, `resetPassword` and `confirmResetPassword` functions. To override a call you must create a new `services` object with an `async` `handle*` function that returns an `aws-amplify` `Auth.*` promise. The service object must then be passed into the `authenticator` component as a `services` prop. For example, let's imagine you'd like to lowercase the `username` and the `email` attributes during `signUp`. @@ -31,32 +31,38 @@ Each `handle*` function will return the neccessary values you'll need to make th - `Auth.signUp` + `signUp` + `Auth.signUp` `handleSignUp` `{username, password, attributes }` - `Auth.signIn` + `signIn` + `Auth.signIn` `handleSignIn` `{username, password}` - `Auth.confirmSignIn` + `confirmSignIn` + `Auth.confirmSignIn` `handleConfirmSignIn` `{user, code, mfaType}` - `Auth.confirmSignUp` + `confirmSignUp` + `Auth.confirmSignUp` `handleConfirmSignUp` `{username, code}` - `Auth.forgotPassword` + `resetPassword` + `Auth.forgotPassword` `handleForgotPassword` `{username}` - `Auth.forgotPasswordSubmit` + `confirmResetPassword` + `Auth.forgotPasswordSubmit` `handleForgotPasswordSubmit` `{username, code, password}` diff --git a/docs/src/pages/[platform]/connected-components/authenticator/customization/overrides/username.angular.mdx b/docs/src/pages/[platform]/connected-components/authenticator/customization/overrides/username.angular.mdx index 6e3ba6bdb0..705fff204d 100644 --- a/docs/src/pages/[platform]/connected-components/authenticator/customization/overrides/username.angular.mdx +++ b/docs/src/pages/[platform]/connected-components/authenticator/customization/overrides/username.angular.mdx @@ -21,8 +21,9 @@ _app.component.ts_ ```js{14} import { Component, OnInit } from '@angular/core'; -import { Amplify, Auth } from 'aws-amplify'; -import awsExports from './aws-exports'; +import { Amplify } from 'aws-amplify'; +import { signUp } from 'aws-amplify/auth' +import amplifyconfig from './amplifyconfiguration.json'; @Component({ selector: 'sign-up-with-email', @@ -30,7 +31,7 @@ import awsExports from './aws-exports'; }) export class SignUpWithEmailComponent implements OnInit { constructor() { - Amplify.configure(awsExports); + Amplify.configure(amplifyconfig); } services = { @@ -39,13 +40,15 @@ export class SignUpWithEmailComponent implements OnInit { // custom username username = username.toLowerCase(); attributes.email = attributes.email.toLowerCase(); - return Auth.signUp({ + return signUp({ username, password, - attributes, - autoSignIn: { - enabled: true, - }, + options: { + userAttributes: { + ...attributes + }, + autoSignIn: true + } }); }, }; diff --git a/docs/src/pages/[platform]/connected-components/authenticator/customization/overrides/username.react.mdx b/docs/src/pages/[platform]/connected-components/authenticator/customization/overrides/username.react.mdx index dff0b154f1..82fd29bbd6 100644 --- a/docs/src/pages/[platform]/connected-components/authenticator/customization/overrides/username.react.mdx +++ b/docs/src/pages/[platform]/connected-components/authenticator/customization/overrides/username.react.mdx @@ -1,9 +1,10 @@ ```jsx{8} -import { Amplify, Auth } from 'aws-amplify'; +import { Amplify } from 'aws-amplify'; +import { signUp } from 'aws-amplify/auth'; import { Authenticator } from '@aws-amplify/ui-react'; import '@aws-amplify/ui-react/styles.css'; -import awsExports from './aws-exports'; -Amplify.configure(awsExports); +import amplifyconfig from './amplifyconfiguration.json'; +Amplify.configure(amplifyconfig); export default function AuthenticatorWithEmail() { const services = { @@ -12,13 +13,15 @@ export default function AuthenticatorWithEmail() { // custom username username = username.toLowerCase(); attributes.email = attributes.email.toLowerCase(); - return Auth.signUp({ + return signUp({ username, password, - attributes, - autoSignIn: { - enabled: true, - }, + options: { + userAttributes: { + ...attributes + }, + autoSignIn: true + } }); }, }; diff --git a/docs/src/pages/[platform]/connected-components/authenticator/customization/overrides/username.vue.mdx b/docs/src/pages/[platform]/connected-components/authenticator/customization/overrides/username.vue.mdx index fdc89ffa6e..d222d86d02 100644 --- a/docs/src/pages/[platform]/connected-components/authenticator/customization/overrides/username.vue.mdx +++ b/docs/src/pages/[platform]/connected-components/authenticator/customization/overrides/username.vue.mdx @@ -1,10 +1,11 @@ ```html