Created
October 2, 2019 02:07
-
-
Save jclk86/12c2dee2c5b4bfa7a28b65bd4b917e86 to your computer and use it in GitHub Desktop.
JWTPAYLOAD
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| handleSubmitBasicAuth = event => { | |
| event.preventDefault(); | |
| this.setState({ error: null }); | |
| const { username, password } = event.target; | |
| AuthApiService.postLogin({ | |
| username: username.value, | |
| password: password.value | |
| }) | |
| .then(res => { | |
| // Retrieves user id from payload. | |
| const userId = res.id.id; <--- user_id passed from my JWT PAYLOAD | |
| username.value = ""; | |
| password.value = ""; | |
| this.props.onLoginSuccess(userId); | |
| }) | |
| .catch(res => { | |
| this.setState({ error: res.error }); | |
| }); | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment