aboutsummaryrefslogtreecommitdiff
path: root/vnext/src/components/LoginButton.js
diff options
context:
space:
mode:
Diffstat (limited to 'vnext/src/components/LoginButton.js')
-rw-r--r--vnext/src/components/LoginButton.js15
1 files changed, 7 insertions, 8 deletions
diff --git a/vnext/src/components/LoginButton.js b/vnext/src/components/LoginButton.js
index 22ae2198..fb3c087e 100644
--- a/vnext/src/components/LoginButton.js
+++ b/vnext/src/components/LoginButton.js
@@ -11,25 +11,24 @@ export default class LoginButton extends React.Component {
username: '',
password: ''
};
- this.toggleModal = this.toggleModal.bind(this);
}
- toggleModal(event) {
+ toggleModal = (event) => {
if (event) event.preventDefault()
this.setState({
isOpen: !this.state.isOpen
});
}
- usernameChanged(event) {
+ usernameChanged = (event) => {
this.setState({
username: event.target.value
})
}
- passwordChanged(event) {
+ passwordChanged = (event) => {
this.setState({
password: event.target.value
})
}
- login(event) {
+ login = (event) => {
event.preventDefault();
let headers = new Headers();
headers.append('Authorization', 'Basic ' + window.btoa(unescape(encodeURIComponent(this.state.username + ":" + this.state.password))));
@@ -67,16 +66,16 @@ export default class LoginButton extends React.Component {
</a>
</div>
<p>Already registered?</p>
- <form onSubmit={this.login.bind(this)}>
+ <form onSubmit={this.login}>
<input className="signinput"
type="text"
name="username"
placeholder="Username..."
- value={this.state.username} onChange={this.usernameChanged.bind(this)} /><br />
+ value={this.state.username} onChange={this.usernameChanged} /><br />
<input className="signinput"
type="password" name="password"
placeholder="Password..."
- value={this.state.password} onChange={this.passwordChanged.bind(this)} /><br />
+ value={this.state.password} onChange={this.passwordChanged} /><br />
<input className="signsubmit" type="submit" value="OK" />
</form>
</div>