Skip to content

Commit

Permalink
fix(MeetingsSdkAdapter): handle joinMeeting with empty password (#340)
Browse files Browse the repository at this point in the history
  • Loading branch information
rsarika authored Oct 1, 2024
1 parent 929b753 commit bf9182e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/MeetingsSDKAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,14 @@ export default class MeetingsSDKAdapter extends MeetingsAdapter {
const sdkMeeting = this.fetchMeeting(ID);

if (sdkMeeting.passwordStatus === 'REQUIRED') {
if (!(options.password || options.hostKey)) {
this.updateMeeting(ID, () => (
{
passwordRequired: true,
}));

return;
}
const res = await sdkMeeting
.verifyPassword(options.hostKey || options.password, options.captcha);

Expand Down
9 changes: 9 additions & 0 deletions src/MeetingsSDKAdapter.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1196,5 +1196,14 @@ describe('Meetings SDK Adapter', () => {
expect(mockSDKMeeting.emit.mock.calls[0][0]).toBe('adapter:meeting:updated');
expect(mockSDKMeeting.emit.mock.calls[0][1]).toMatchObject(mockResponse2);
});

it('joinMeeting with empty password', async () => {
mockSDKMeeting.verifyPassword = jest.fn();
await meetingsSDKAdapter.joinMeeting(meetingID, {password: ''});

expect(mockSDKMeeting.verifyPassword).not.toHaveBeenCalled();
expect(mockSDKMeeting.emit).toHaveBeenCalledTimes(1);
expect(mockSDKMeeting.join).not.toHaveBeenCalled();
});
});
});

0 comments on commit bf9182e

Please sign in to comment.