aboutsummaryrefslogtreecommitdiff
path: root/diplomacy/web
diff options
context:
space:
mode:
authorPhilip Paquette <pcpaquette@gmail.com>2019-09-11 17:34:18 -0400
committerPhilip Paquette <pcpaquette@gmail.com>2019-09-14 18:18:53 -0400
commit96c5441ac652bb2e7e396381d3fb2e0964ad68da (patch)
tree29a582fd80553b47ea25d25908f2b624ae5c54c8 /diplomacy/web
parent57c9c33ae756cc17af223f6bc671191684ee9c9b (diff)
channel.authenticate() - Deprecated argument 'create_user'
- User is now created by default if it doesn't exist on the server - Unless the server prevents new registrations
Diffstat (limited to 'diplomacy/web')
-rw-r--r--diplomacy/web/src/diplomacy/client/connection.js5
-rw-r--r--diplomacy/web/src/diplomacy/communication/requests.js2
-rw-r--r--diplomacy/web/src/gui/pages/content_connection.jsx6
3 files changed, 4 insertions, 9 deletions
diff --git a/diplomacy/web/src/diplomacy/client/connection.js b/diplomacy/web/src/diplomacy/client/connection.js
index 54f6f2d..c1f8bfd 100644
--- a/diplomacy/web/src/diplomacy/client/connection.js
+++ b/diplomacy/web/src/diplomacy/client/connection.js
@@ -340,11 +340,10 @@ export class Connection {
return requestContext.future;
}
- authenticate(username, password, createUser = false) {
+ authenticate(username, password) {
return this.send(REQUESTS.create('sign_in', {
username: username,
- password: password,
- create_user: createUser
+ password: password
})).promise();
}
diff --git a/diplomacy/web/src/diplomacy/communication/requests.js b/diplomacy/web/src/diplomacy/communication/requests.js
index 6902b5f..a4a140e 100644
--- a/diplomacy/web/src/diplomacy/communication/requests.js
+++ b/diplomacy/web/src/diplomacy/communication/requests.js
@@ -35,7 +35,7 @@ export const REQUESTS = {
* - request phase dependent (optional, for game requests): boolean (default, true)
* **/
models: {
- sign_in: {level: null, model: {username: null, password: null, create_user: null}},
+ sign_in: {level: null, model: {username: null, password: null}},
create_game: {
level: STRINGS.CHANNEL,
model: {
diff --git a/diplomacy/web/src/gui/pages/content_connection.jsx b/diplomacy/web/src/gui/pages/content_connection.jsx
index 01b0650..a7a151f 100644
--- a/diplomacy/web/src/gui/pages/content_connection.jsx
+++ b/diplomacy/web/src/gui/pages/content_connection.jsx
@@ -46,11 +46,7 @@ export class ContentConnection extends React.Component {
page.connection = this.connection;
this.connection = null;
page.success(`Successfully connected to server ${data.username}:${data.port}`);
- page.connection.authenticate(data.username, data.password, false)
- .catch((error) => {
- page.error(`Unable to sign in, trying to create an account, error: ${error}`);
- return page.connection.authenticate(data.username, data.password, true);
- })
+ page.connection.authenticate(data.username, data.password)
.then((channel) => {
page.channel = channel;
return channel.getAvailableMaps();