logic/auth.js
// Log the user into the device. Caches the password if login is successful. Then returns jwt.
Log the user into the device. Caches the password if login is successful. Then returns jwt.
Log the user into the device . Caches the password if login is successful . Then returns jwt .
async function login(user) {
    try {
        const jwt = await JWTHelper.generateJWT(user.username);
        cachePassword(user.password);
        deriveUmbrelSeed(user)
        setSystemPassword(user.password);
        removeLndPasswordIfLocked(user.password, jwt);
        return { jwt: jwt };
    } catch (error) {
        throw new NodeError('Unable to generate JWT');
    }
}
async function login ( user ) { try { const jwt = await JWTHelper . generateJWT ( user . username ) ; cachePassword ( user . password ) ; deriveUmbrelSeed ( user ) setSystemPassword ( user . password ) ; removeLndPasswordIfLocked ( user . password , jwt ) ; return { jwt : jwt } ; } catch ( error ) { throw new NodeError ( 'Unable to generate JWT' ) ; } }
Log the user into the device.
Log the user into the device .
// Cache plain text password // cachePassword(user.plainTextPassword); // This is only needed temporarily to update hardcoded passwords // on existing users without requiring them to change their password // This is only needed temporarily to remove the user set LND wallet // password for old users and change it to a hardcoded one so we can // auto unlock it in the future.