chore: Remove Unused Dependencies 🧹 (#939)

* chore: cleanup client depend 🧹

* chore: replace joi with zod and remove unused user validator

* chore: move dep from root to api, cleanup other unused api deps

* chore: remove unused dev dep

* chore: update bun lockfile

* fix: bun scripts

* chore: add bun flag to update script

* chore: remove legacy webpack + babel dev deps

* chore: add back dev deps needed for frontend unit testing

* fix(validators): make schemas as expected and more robust with a full test suite of edge cases

* chore: remove axios from root package, remove path from api, update bun
This commit is contained in:
Danny Avila 2023-09-14 15:12:22 -04:00 committed by GitHub
parent 7f5b0b5310
commit b3afd562b9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 1935 additions and 4938 deletions

View file

@ -1,11 +1,11 @@
const { Strategy: PassportLocalStrategy } = require('passport-local');
const User = require('../models/User');
const { loginSchema } = require('./validators');
const { loginSchema, errorsToString } = require('./validators');
const DebugControl = require('../utils/debug.js');
async function validateLoginRequest(req) {
const { error } = loginSchema.validate(req.body);
return error ? error.details[0].message : null;
const { error } = loginSchema.safeParse(req.body);
return error ? errorsToString(error.errors) : null;
}
async function findUserByEmail(email) {