UNPKG

cognito-srp

Version:

Secure Remote Password protocol implementation compatible with Amazon Cognito.

19 lines (18 loc) 665 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const lib_1 = require("../lib"); const constants_1 = require("./constants"); describe('ServerPasswordChallenge', () => { let challenge; beforeAll(() => { challenge = new lib_1.ServerPasswordChallenge(constants_1.poolname, constants_1.serverUser, constants_1.secret); }); it('should calculate A', () => { const B = challenge.calculateB(); expect(B).toMatchSnapshot(); }); it('should get a session', () => { const session = challenge.getSession(constants_1.publicKey); expect(session.getHkdf()).toMatchSnapshot(); }); });