tolulope-od/banka

View on GitHub
server/controllers/AuthController.js

Summary

Maintainability
A
2 hrs
Test Coverage

Function signIn has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  static async signIn(req, res) {
    const { email, password } = req.body;
    const findUser = await users.select(['*'], [`email='${email}'`]);
    if (findUser.length > 0) {
      const verifyPassword = bcrypt.compareSync(password, findUser[0].password);
Severity: Minor
Found in server/controllers/AuthController.js - About 1 hr to fix

    Function signUp has 36 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      static async signUp(req, res) {
        const { firstName, lastName, email, password } = req.body;
        const existingUser = await users.select(['email'], [`email='${email}'`]);
        if (existingUser.length > 0) {
          return res.status(409).json({
    Severity: Minor
    Found in server/controllers/AuthController.js - About 1 hr to fix

      There are no issues that match your filters.

      Category
      Status