mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-08-27 12:13:30 +00:00
Some checks are pending
Docker Dev Branch Images Build / build (Dockerfile, lc-dev, node) (push) Waiting to run
Docker Dev Branch Images Build / build (Dockerfile.multi, lc-dev-api, api-build) (push) Waiting to run
GitNexus Index / index (push) Waiting to run
GitNexus Index / post-index (push) Blocked by required conditions
* fix: restore invite-user CLI
* fix: guard createInvite failure shape in invite-user CLI
createInvite resolves to { message } on error rather than throwing, so the
CLI interpolated it into the register link as [object Object] and emailed
an unusable invite.
* fix: normalize invite email before token creation
findToken lowercases its email query but the Token schema has no lowercase
setter, so a mixed-case address passed to the CLI was stored verbatim and
the resulting invite could never be redeemed.
---------
Co-authored-by: Danny Avila <danny@librechat.ai>
16 lines
535 B
JavaScript
16 lines
535 B
JavaScript
jest.mock('../connect', () => jest.fn(() => new Promise(() => {})));
|
|
|
|
describe('Invite user CLI', () => {
|
|
it('loads its runtime dependencies', () => {
|
|
const existingHandlers = new Set(process.listeners('uncaughtException'));
|
|
|
|
try {
|
|
expect(() => require('../invite-user')).not.toThrow();
|
|
} finally {
|
|
process
|
|
.listeners('uncaughtException')
|
|
.filter((handler) => !existingHandlers.has(handler))
|
|
.forEach((handler) => process.removeListener('uncaughtException', handler));
|
|
}
|
|
});
|
|
});
|