Skip to content

Commit abdaa61

Browse files
committed
Updating to use new username attribute
1 parent f17b99d commit abdaa61

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
"react-router-bootstrap": "^0.24.4",
1111
"react-router-dom": "^4.2.2",
1212
"react-scripts": "1.1.1",
13-
"react-stripe-elements": "^1.6.0",
14-
"uuid": "^3.2.1"
13+
"react-stripe-elements": "^1.6.0"
1514
},
1615
"scripts": {
1716
"start": "react-scripts start",

src/containers/Signup.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import React, { Component } from "react";
2-
import uuidv4 from "uuid/v4";
32
import {
43
HelpBlock,
54
FormGroup,
@@ -49,11 +48,8 @@ export default class Signup extends Component {
4948

5049
try {
5150
const newUser = await Auth.signUp({
52-
username: uuidv4(),
53-
password: this.state.password,
54-
attributes: {
55-
email: this.state.email
56-
}
51+
username: this.state.email,
52+
password: this.state.password
5753
});
5854
this.setState({
5955
newUser
@@ -71,7 +67,7 @@ export default class Signup extends Component {
7167
this.setState({ isLoading: true });
7268

7369
try {
74-
await Auth.confirmSignUp(this.state.newUser.user.username, this.state.confirmationCode);
70+
await Auth.confirmSignUp(this.state.email, this.state.confirmationCode);
7571
await Auth.signIn(this.state.email, this.state.password);
7672

7773
this.props.userHasAuthenticated(true);

0 commit comments

Comments
 (0)