Fixed another signup bug

This commit is contained in:
2019-05-25 22:07:29 +10:00
parent eb612f01d6
commit 862abbdb31
4 changed files with 20 additions and 3 deletions
+12
View File
@@ -0,0 +1,12 @@
Critical Signup Bug
---
_25 May 2019_
I screwed myself over with the throttling system.
The throttle system is designed to prevent too many requests from being processed by the server at once. The problem is, during signup, if you pressed the signup button more than once, it would send more than one request, and process the second request without sending a second email.
The direct upshot of this is that several people have been unable to signup to the game, and I apologize for that. I've altered the server code to react more quickly, and the client code will now disable the signup button as soon as you press it. As long as you aren't deliberately interferring with the server, you shouldn't run afoul of the throttle ever again.
Thank you for your patience during our teething phase.
+1 -1
View File
@@ -37,7 +37,7 @@ class Login extends React.Component {
<input type='password' name='password' value={this.state.password} onChange={this.updatePassword.bind(this)} />
</div>
<button type='submit'>Login</button>
<button type='submit' disabled={!this.state.email}>Login</button>
</form>
</div>
);
+3 -1
View File
@@ -29,7 +29,7 @@ class PasswordRecover extends React.Component {
<input type='text' name='email' value={this.state.email} onChange={this.updateEmail.bind(this)} />
</div>
<button type='submit'>Send Email</button>
<button type='submit' disabled={!this.state.email}>Send Email</button>
</form>
</div>
);
@@ -65,6 +65,8 @@ class PasswordRecover extends React.Component {
//send the XHR
xhr.open('POST', form.action, true);
xhr.send(formData);
this.clearInput();
}
validateInput(e) {
+4 -1
View File
@@ -47,7 +47,7 @@ export default class Signup extends React.Component {
<input type='password' name='retype' value={this.state.retype} onChange={this.updateRetype.bind(this)} />
</div>
<button type='submit'>Sign Up</button>
<button type='submit' disabled={!this.state.email}>Sign Up</button>
</form>
</div>
);
@@ -82,6 +82,8 @@ export default class Signup extends React.Component {
//send the XHR
xhr.open('POST', form.action, true);
xhr.send(formData);
this.clearInput();
}
validateInput() {
@@ -118,6 +120,7 @@ export default class Signup extends React.Component {
clearInput() {
this.setState({
email: '',
username: '',
password: '',
retype: '',
warning: ''