Coder Social home page Coder Social logo

alexxandergrib / passwords-crypto Goto Github PK

View Code? Open in Web Editor NEW
4.0 4.0 0.0 2.06 MB

:lock: Password hashing and verification library providing single interface for SHA256, SCrypt, BCrypt, Argon2 and PBKDF2 algorithms

License: MIT License

JavaScript 15.84% TypeScript 84.16%

passwords-crypto's Introduction

Hi, im Alexander 👋

WebsiteTelegramПерейти на Русский 🇷🇺

Projects & Areas of Expertise

OpenSource Contributions

Github Stats

GitHub stats

passwords-crypto's People

Contributors

alexxandergrib avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

passwords-crypto's Issues

Crypt.verify outputting diagnostic information

I've noticed that when I call .verify() it actually prints some diagnostic information such as the name of the adapter being used as well as the hash itself.

image

Is this intended behaviour? I can't seem to find any sign that either my code or the .verify() implementations would output anything.

Apologies if this is a mistake on my end.

Here's the function that calls .verify():

async function loginUser(username: string, password: string) {
    let user = await User.findOne({$or:[{username: username}, {email: username}]});

    if (user === null) {
        throw new Error("Login failed: user not found")
    }

    // Validate password

    let isPasswordCorrect = await crypt.verify(user.password, password);

    if (!isPasswordCorrect) {
        throw new Error("Login failed: incorrect password")
    }
    return user;
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.