Skip to content

Commit e0e4703

Browse files
committed
fix authentication issue
1 parent 2825b70 commit e0e4703

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

src/components/Login.js

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ class Login extends Component {
6363
password,
6464
},
6565
})
66-
const { user, token } = result.data.login
67-
this._saveUserData(user.id, token)
66+
const { token } = result.data.login
67+
this._saveUserData(token)
6868
} else {
6969
const result = await this.props.signupMutation({
7070
variables: {
@@ -73,8 +73,8 @@ class Login extends Component {
7373
password,
7474
},
7575
})
76-
const { user, token } = result.data.signup
77-
this._saveUserData(user.id, token)
76+
const { token } = result.data.signup
77+
this._saveUserData(token)
7878
}
7979
this.props.history.push(`/`)
8080
}
@@ -87,9 +87,6 @@ class Login extends Component {
8787
const SIGNUP_MUTATION = gql`
8888
mutation SignupMutation($email: String!, $password: String!, $name: String!) {
8989
signup(email: $email, password: $password, name: $name) {
90-
user {
91-
id
92-
}
9390
token
9491
}
9592
}
@@ -98,9 +95,6 @@ const SIGNUP_MUTATION = gql`
9895
const LOGIN_MUTATION = gql`
9996
mutation LoginMutation($email: String!, $password: String!) {
10097
login(email: $email, password: $password) {
101-
user {
102-
id
103-
}
10498
token
10599
}
106100
}

0 commit comments

Comments
 (0)