diff --git a/change/@microsoft-teams-js-7668fe92-8f01-4492-804f-faba71615848.json b/change/@microsoft-teams-js-7668fe92-8f01-4492-804f-faba71615848.json new file mode 100644 index 0000000000..49451b2ac1 --- /dev/null +++ b/change/@microsoft-teams-js-7668fe92-8f01-4492-804f-faba71615848.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Removed the max length validation from the `authentication.authenticate` API.", + "packageName": "@microsoft/teams-js", + "email": "jeklouda@microsoft.com", + "dependentChangeType": "patch" +} diff --git a/packages/teams-js/src/internal/utils.ts b/packages/teams-js/src/internal/utils.ts index 652871eaad..42b9785d0a 100644 --- a/packages/teams-js/src/internal/utils.ts +++ b/packages/teams-js/src/internal/utils.ts @@ -427,9 +427,6 @@ export function validateUrl(url: URL, errorToThrow?: Error): void { if (hasScriptTags(urlString)) { throw errorToThrow || new Error('Invalid Url'); } - if (urlString.length > 2048) { - throw errorToThrow || new Error('Url exceeds the maximum size of 2048 characters'); - } if (!isValidHttpsURL(url)) { throw errorToThrow || new Error('Url should be a valid https url'); } diff --git a/packages/teams-js/test/internal/utils.spec.ts b/packages/teams-js/test/internal/utils.spec.ts index a024682cac..6936139137 100644 --- a/packages/teams-js/test/internal/utils.spec.ts +++ b/packages/teams-js/test/internal/utils.spec.ts @@ -268,15 +268,6 @@ describe('utils', () => { expect(error).toEqual(new Error('Invalid Url')); } }); - it('should throw maxlength exceed error if it contains more than 2048 chars', async () => { - expect.assertions(1); - const url = 'https://example.com?param=' + 'a'.repeat(2048); - try { - validateUrl(new URL(url)); - } catch (error) { - expect(error).toEqual(new Error('Url exceeds the maximum size of 2048 characters')); - } - }); it('should throw invalid url error if it non http url', async () => { expect.assertions(1); // eslint-disable-next-line @microsoft/sdl/no-insecure-url