From 8992fed59143c85eb08c58972002f917f3c5e8c0 Mon Sep 17 00:00:00 2001 From: ntr Date: Mon, 23 Sep 2019 13:54:06 +1000 Subject: [PATCH 1/2] don't create account img on register --- server/src/account.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/account.rs b/server/src/account.rs index 10e0138f..11776a4b 100644 --- a/server/src/account.rs +++ b/server/src/account.rs @@ -348,7 +348,7 @@ pub fn create(name: &String, password: &String, tx: &mut Transaction) -> Result< .insert(tx)?; } - img::shapes_write(img)?; + // img::shapes_write(img)?; info!("registration account={:?}", name); From f6ff6d37e3b0890fd00d84ef4cbce7a8d2c163af Mon Sep 17 00:00:00 2001 From: ntr Date: Mon, 23 Sep 2019 14:11:40 +1000 Subject: [PATCH 2/2] patch uuid generator into migrations --- client/src/components/welcome.about.jsx | 69 --------------------- ops/migrations/20190914191207_shapes-mtx.js | 4 ++ 2 files changed, 4 insertions(+), 69 deletions(-) delete mode 100644 client/src/components/welcome.about.jsx diff --git a/client/src/components/welcome.about.jsx b/client/src/components/welcome.about.jsx deleted file mode 100644 index 0f33b942..00000000 --- a/client/src/components/welcome.about.jsx +++ /dev/null @@ -1,69 +0,0 @@ -// eslint-disable-next-line -const preact = require('preact'); -const { Component } = require('preact') -const { connect } = require('preact-redux'); -const linkState = require('linkstate').default; - -const { postData, errorToast, infoToast } = require('../utils'); - -const addState = connect( - (state) => { - const { - ws - } = state; - - function submitRegister(name, password, code) { - postData('/account/register', { name, password, code }) - .then(res => res.json()) - .then(data => { - if (data.error) return errorToast(data.error); - infoToast(data.message); - ws.connect(); - }) - .catch(error => errorToast(error)); - } - - return { - submitRegister, - } - }, -); - -function Register(args) { - const { - submitRegister, - navRegister, - } = args; - - return ( - - ); -} - -module.exports = addState(Register); diff --git a/ops/migrations/20190914191207_shapes-mtx.js b/ops/migrations/20190914191207_shapes-mtx.js index 4d7f5e3c..34f56d52 100644 --- a/ops/migrations/20190914191207_shapes-mtx.js +++ b/ops/migrations/20190914191207_shapes-mtx.js @@ -2,6 +2,10 @@ const uuidv4 = require('uuid/v4'); // give everybody the shapes mtx exports.up = async knex => { + await knex.raw(` + CREATE EXTENSION IF NOT EXISTS "uuid-ossp"; + `); + await knex.raw(` INSERT INTO mtx (id, account, variant) SELECT uuid_generate_v4() as id, id as account, 'Shapes'