diff options
| author | Adam Soltys <[email protected]> | 2021-08-30 17:49:03 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2021-08-30 19:35:36 -0700 |
| commit | 3e61c801fc3ca9644304c88f86adf5aa297aeef4 (patch) | |
| tree | 6eafce644f073b4cb85e5a79ac6c94133fc865b9 /lib/utils.js | |
| parent | 8198ea6beec15f33015483cb911a58a0bc8f0d2e (diff) | |
| download | coinos-server-3e61c801fc3ca9644304c88f86adf5aa297aeef4.tar.gz coinos-server-3e61c801fc3ca9644304c88f86adf5aa297aeef4.zip | |
strip spaces from usernames
Diffstat (limited to 'lib/utils.js')
| -rw-r--r-- | lib/utils.js | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/utils.js b/lib/utils.js index 23c811c1..8e857659 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -6,10 +6,12 @@ getUser = async (username, transaction) => { include: [ { model: db.Account, - as: "account" - } + as: "account", + }, ], - where: { username } + where: { + username: { [Op.or]: [username, username.replace(/ /g, "")] }, + }, }; if (transaction) { @@ -28,10 +30,10 @@ getUserById = async (id, transaction) => { include: [ { model: db.Account, - as: "account" - } + as: "account", + }, ], - where: { id } + where: { id }, }; if (transaction) { |
