diff --git a/.changeset/poor-buttons-check.md b/.changeset/poor-buttons-check.md deleted file mode 100644 index 27ba9ad..0000000 --- a/.changeset/poor-buttons-check.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@telegram-auth/react": patch ---- - -Fixed conditional rendering of login button diff --git a/packages/react/CHANGELOG.md b/packages/react/CHANGELOG.md index 2842d61..eef8b17 100644 --- a/packages/react/CHANGELOG.md +++ b/packages/react/CHANGELOG.md @@ -1,5 +1,11 @@ # @telegram-auth/react Change Log +## 1.0.4 + +### Patch Changes + +- [#28](https://github.com/manzoorwanijk/telegram-auth/pull/28) [`d84bbd2`](https://github.com/manzoorwanijk/telegram-auth/commit/d84bbd25374d4a40c9b0166c23c16487f05d97de) Thanks [@manzoorwanijk](https://github.com/manzoorwanijk)! - Fixed conditional rendering of login button + ## 1.0.3 ### Patch Changes diff --git a/packages/react/docs/README.md b/packages/react/docs/README.md index bca0221..76c0d0d 100644 --- a/packages/react/docs/README.md +++ b/packages/react/docs/README.md @@ -41,13 +41,13 @@ https://core.telegram.org/widgets/login #### Defined in -[LoginButton.tsx:23](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/react/src/LoginButton.tsx#L23) +[LoginButton.tsx:23](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/react/src/LoginButton.tsx#L23) ___ ### createScript -▸ **createScript**(`options`): [`HTMLScriptElement`]( https://developer.mozilla.org/en-US/docs/Web/API/HTMLScriptElement ) +▸ **createScript**(`options`): [`HTMLScriptElement`]( https://developer.mozilla.org/docs/Web/API/HTMLScriptElement ) It creates a script tag with the right attributes to load the Telegram widget @@ -59,7 +59,7 @@ It creates a script tag with the right attributes to load the Telegram widget #### Returns -[`HTMLScriptElement`]( https://developer.mozilla.org/en-US/docs/Web/API/HTMLScriptElement ) +[`HTMLScriptElement`]( https://developer.mozilla.org/docs/Web/API/HTMLScriptElement ) A script element @@ -69,4 +69,4 @@ https://core.telegram.org/widgets/login #### Defined in -[createScript.ts:11](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/react/src/createScript.ts#L11) +[createScript.ts:11](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/react/src/createScript.ts#L11) diff --git a/packages/react/docs/interfaces/CreateScriptOptions.md b/packages/react/docs/interfaces/CreateScriptOptions.md index a4c6929..cdcfcf1 100644 --- a/packages/react/docs/interfaces/CreateScriptOptions.md +++ b/packages/react/docs/interfaces/CreateScriptOptions.md @@ -38,7 +38,7 @@ The username of the bot that will be used to authenticate the user. #### Defined in -[types.ts:25](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/react/src/types.ts#L25) +[types.ts:25](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/react/src/types.ts#L25) ___ @@ -54,7 +54,7 @@ The URL where the auth data from Telegram will be sent. #### Defined in -[types.ts:20](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/react/src/types.ts#L20) +[types.ts:20](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/react/src/types.ts#L20) ___ @@ -76,7 +76,7 @@ The size of the button. #### Defined in -[types.ts:32](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/react/src/types.ts#L32) +[types.ts:32](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/react/src/types.ts#L32) ___ @@ -92,7 +92,7 @@ The radius of the button corners. #### Defined in -[types.ts:37](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/react/src/types.ts#L37) +[types.ts:37](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/react/src/types.ts#L37) ___ @@ -114,7 +114,7 @@ The language of the button. #### Defined in -[types.ts:44](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/react/src/types.ts#L44) +[types.ts:44](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/react/src/types.ts#L44) ___ @@ -122,12 +122,12 @@ ___ • `Optional` **onAuthCallback**: (`data`: [`TelegramAuthData`](TelegramAuthData.md)) => `void` +The callback function that will be called when the user is authenticated. + #### Type declaration ▸ (`data`): `void` -The callback function that will be called when the user is authenticated. - ##### Parameters | Name | Type | @@ -144,7 +144,7 @@ The callback function that will be called when the user is authenticated. #### Defined in -[types.ts:49](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/react/src/types.ts#L49) +[types.ts:49](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/react/src/types.ts#L49) ___ @@ -166,7 +166,7 @@ The access level that the bot will request. #### Defined in -[types.ts:56](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/react/src/types.ts#L56) +[types.ts:56](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/react/src/types.ts#L56) ___ @@ -188,7 +188,7 @@ true #### Defined in -[types.ts:63](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/react/src/types.ts#L63) +[types.ts:63](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/react/src/types.ts#L63) ___ @@ -204,4 +204,4 @@ The version of the Telegram widget to deal with browser caching. #### Defined in -[types.ts:68](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/react/src/types.ts#L68) +[types.ts:68](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/react/src/types.ts#L68) diff --git a/packages/react/docs/interfaces/LoginButtonProps.md b/packages/react/docs/interfaces/LoginButtonProps.md index 38e434e..1bc2962 100644 --- a/packages/react/docs/interfaces/LoginButtonProps.md +++ b/packages/react/docs/interfaces/LoginButtonProps.md @@ -32,7 +32,7 @@ The username of the bot that will be used to authenticate the user. #### Defined in -[types.ts:25](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/react/src/types.ts#L25) +[types.ts:25](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/react/src/types.ts#L25) ___ @@ -44,7 +44,7 @@ The URL where the auth data from Telegram will be sent. #### Defined in -[types.ts:20](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/react/src/types.ts#L20) +[types.ts:20](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/react/src/types.ts#L20) ___ @@ -62,7 +62,7 @@ The size of the button. #### Defined in -[types.ts:32](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/react/src/types.ts#L32) +[types.ts:32](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/react/src/types.ts#L32) ___ @@ -74,7 +74,7 @@ The radius of the button corners. #### Defined in -[types.ts:37](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/react/src/types.ts#L37) +[types.ts:37](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/react/src/types.ts#L37) ___ @@ -92,7 +92,7 @@ The language of the button. #### Defined in -[types.ts:44](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/react/src/types.ts#L44) +[types.ts:44](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/react/src/types.ts#L44) ___ @@ -100,12 +100,12 @@ ___ • `Optional` **onAuthCallback**: (`data`: [`TelegramAuthData`](TelegramAuthData.md)) => `void` +The callback function that will be called when the user is authenticated. + #### Type declaration ▸ (`data`): `void` -The callback function that will be called when the user is authenticated. - ##### Parameters | Name | Type | @@ -118,7 +118,7 @@ The callback function that will be called when the user is authenticated. #### Defined in -[types.ts:49](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/react/src/types.ts#L49) +[types.ts:49](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/react/src/types.ts#L49) ___ @@ -136,7 +136,7 @@ The access level that the bot will request. #### Defined in -[types.ts:56](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/react/src/types.ts#L56) +[types.ts:56](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/react/src/types.ts#L56) ___ @@ -154,7 +154,7 @@ true #### Defined in -[types.ts:63](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/react/src/types.ts#L63) +[types.ts:63](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/react/src/types.ts#L63) ___ @@ -166,4 +166,4 @@ The version of the Telegram widget to deal with browser caching. #### Defined in -[types.ts:68](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/react/src/types.ts#L68) +[types.ts:68](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/react/src/types.ts#L68) diff --git a/packages/react/docs/interfaces/TelegramAuthData.md b/packages/react/docs/interfaces/TelegramAuthData.md index b1d9e26..ca05194 100644 --- a/packages/react/docs/interfaces/TelegramAuthData.md +++ b/packages/react/docs/interfaces/TelegramAuthData.md @@ -28,7 +28,7 @@ https://core.telegram.org/widgets/login#receiving-authorization-data #### Defined in -[types.ts:7](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/react/src/types.ts#L7) +[types.ts:7](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/react/src/types.ts#L7) ___ @@ -38,7 +38,7 @@ ___ #### Defined in -[types.ts:8](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/react/src/types.ts#L8) +[types.ts:8](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/react/src/types.ts#L8) ___ @@ -48,7 +48,7 @@ ___ #### Defined in -[types.ts:9](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/react/src/types.ts#L9) +[types.ts:9](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/react/src/types.ts#L9) ___ @@ -58,7 +58,7 @@ ___ #### Defined in -[types.ts:10](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/react/src/types.ts#L10) +[types.ts:10](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/react/src/types.ts#L10) ___ @@ -68,7 +68,7 @@ ___ #### Defined in -[types.ts:11](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/react/src/types.ts#L11) +[types.ts:11](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/react/src/types.ts#L11) ___ @@ -78,7 +78,7 @@ ___ #### Defined in -[types.ts:12](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/react/src/types.ts#L12) +[types.ts:12](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/react/src/types.ts#L12) ___ @@ -88,4 +88,4 @@ ___ #### Defined in -[types.ts:13](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/react/src/types.ts#L13) +[types.ts:13](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/react/src/types.ts#L13) diff --git a/packages/react/package.json b/packages/react/package.json index 9bbbb33..3f4d293 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -1,6 +1,6 @@ { "name": "@telegram-auth/react", - "version": "1.0.3", + "version": "1.0.4", "description": "React component to display Telegram Login Widget", "keywords": [ "telegram", diff --git a/packages/server/docs/README.md b/packages/server/docs/README.md index 56fe161..491b95d 100644 --- a/packages/server/docs/README.md +++ b/packages/server/docs/README.md @@ -28,19 +28,19 @@ ### AuthDataMap -Ƭ **AuthDataMap**: [`Map`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map )<`string`, `string` \| `number`\> +Ƭ **AuthDataMap**: [`Map`]( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Map )\<`string`, `string` \| `number`\> Shape of the data to be passed AuthDataValidator.validate(). #### Defined in -[utils/types.ts:4](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/server/src/utils/types.ts#L4) +[utils/types.ts:4](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/server/src/utils/types.ts#L4) ## Functions ### hexStringToArrayBuffer -▸ **hexStringToArrayBuffer**(`hexString`): [`Uint8Array`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array ) +▸ **hexStringToArrayBuffer**(`hexString`): [`Uint8Array`]( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array ) It takes a hex string and returns an array buffer @@ -52,13 +52,13 @@ It takes a hex string and returns an array buffer #### Returns -[`Uint8Array`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array ) +[`Uint8Array`]( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array ) A Uint8Array of the hexString. #### Defined in -[utils/hexStringToArrayBuffer.ts:7](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/server/src/utils/hexStringToArrayBuffer.ts#L7) +[utils/hexStringToArrayBuffer.ts:7](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/server/src/utils/hexStringToArrayBuffer.ts#L7) ___ @@ -73,7 +73,7 @@ It's useful for parsing the URLSearchParams received from Telegram. | Name | Type | Description | | :------ | :------ | :------ | -| `searchParams` | [`URLSearchParams`]( https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams ) | URLSearchParams | +| `searchParams` | [`URLSearchParams`]( https://developer.mozilla.org/docs/Web/API/URLSearchParams ) | URLSearchParams | #### Returns @@ -83,7 +83,7 @@ A new Map object with the entries from the searchParams object. #### Defined in -[utils/searchParamsToAuthDataMap.ts:10](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/server/src/utils/searchParamsToAuthDataMap.ts#L10) +[utils/searchParamsToAuthDataMap.ts:10](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/server/src/utils/searchParamsToAuthDataMap.ts#L10) ___ @@ -97,7 +97,7 @@ It takes an object and returns auth data Map | Name | Type | Description | | :------ | :------ | :------ | -| `data` | [`Record`]( https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type )<`string`, `string` \| `number`\> | The object to convert to a Map | +| `data` | [`Record`]( https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type )\<`string`, `string` \| `number`\> | The object to convert to a Map | #### Returns @@ -107,13 +107,13 @@ A new Map object with the entries of the object passed in. #### Defined in -[utils/objectToAuthDataMap.ts:9](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/server/src/utils/objectToAuthDataMap.ts#L9) +[utils/objectToAuthDataMap.ts:9](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/server/src/utils/objectToAuthDataMap.ts#L9) ___ ### urlStrToAuthDataMap -▸ **urlStrToAuthDataMap**(`urlStr`): [`Map`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map )<`string`, `string`\> +▸ **urlStrToAuthDataMap**(`urlStr`): [`Map`]( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Map )\<`string`, `string`\> It takes a URL string and returns auth data Map from the URL's query parameters. It's useful for parsing the URL received from Telegram. @@ -126,10 +126,10 @@ It's useful for parsing the URL received from Telegram. #### Returns -[`Map`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map )<`string`, `string`\> +[`Map`]( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Map )\<`string`, `string`\> A Map object with the key/value pairs from the URL's query string. #### Defined in -[utils/urlStrToAuthDataMap.ts:8](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/server/src/utils/urlStrToAuthDataMap.ts#L8) +[utils/urlStrToAuthDataMap.ts:8](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/server/src/utils/urlStrToAuthDataMap.ts#L8) diff --git a/packages/server/docs/classes/AuthDataValidator.md b/packages/server/docs/classes/AuthDataValidator.md index 9b2aa27..9d75ccc 100644 --- a/packages/server/docs/classes/AuthDataValidator.md +++ b/packages/server/docs/classes/AuthDataValidator.md @@ -27,7 +27,7 @@ https://core.telegram.org/widgets/login#checking-authorization ### constructor -• **new AuthDataValidator**(`«destructured»?`) +• **new AuthDataValidator**(`«destructured»?`): [`AuthDataValidator`](AuthDataValidator.md) #### Parameters @@ -35,9 +35,13 @@ https://core.telegram.org/widgets/login#checking-authorization | :------ | :------ | | `«destructured»` | [`AuthDataValidatorOptions`](../interfaces/AuthDataValidatorOptions.md) | +#### Returns + +[`AuthDataValidator`](AuthDataValidator.md) + #### Defined in -[AuthDataValidator.ts:55](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/server/src/AuthDataValidator.ts#L55) +[AuthDataValidator.ts:55](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/server/src/AuthDataValidator.ts#L55) ## Methods @@ -59,7 +63,7 @@ Sets the bot token to be used for validating the data #### Defined in -[AuthDataValidator.ts:96](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/server/src/AuthDataValidator.ts#L96) +[AuthDataValidator.ts:96](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/server/src/AuthDataValidator.ts#L96) ___ @@ -73,7 +77,7 @@ Sets the crypto to be used for validating the data | Name | Type | Description | | :------ | :------ | :------ | -| `subtleCrypto` | [`SubtleCrypto`]( https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto ) | The crypto to be used | +| `subtleCrypto` | [`SubtleCrypto`]( https://developer.mozilla.org/docs/Web/API/SubtleCrypto ) | The crypto to be used | #### Returns @@ -81,7 +85,7 @@ Sets the crypto to be used for validating the data #### Defined in -[AuthDataValidator.ts:107](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/server/src/AuthDataValidator.ts#L107) +[AuthDataValidator.ts:107](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/server/src/AuthDataValidator.ts#L107) ___ @@ -95,7 +99,7 @@ Sets the encoder to be used for encoding the data | Name | Type | Description | | :------ | :------ | :------ | -| `encoder` | [`TextEncoder`]( https://developer.mozilla.org/en-US/docs/Web/API/TextEncoder ) | The encoder to be used | +| `encoder` | [`TextEncoder`]( https://developer.mozilla.org/docs/Web/API/TextEncoder ) | The encoder to be used | #### Returns @@ -103,7 +107,7 @@ Sets the encoder to be used for encoding the data #### Defined in -[AuthDataValidator.ts:118](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/server/src/AuthDataValidator.ts#L118) +[AuthDataValidator.ts:118](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/server/src/AuthDataValidator.ts#L118) ___ @@ -126,7 +130,7 @@ which is the number of seconds after which the data is considered invalid. #### Defined in -[AuthDataValidator.ts:131](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/server/src/AuthDataValidator.ts#L131) +[AuthDataValidator.ts:131](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/server/src/AuthDataValidator.ts#L131) ___ @@ -148,13 +152,13 @@ This function sets the throwIfEmptyData property of the class. #### Defined in -[AuthDataValidator.ts:142](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/server/src/AuthDataValidator.ts#L142) +[AuthDataValidator.ts:142](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/server/src/AuthDataValidator.ts#L142) ___ ### validate -▸ **validate**<`T`\>(`authDataMap`): [`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`T`\> +▸ **validate**\<`T`\>(`authDataMap`): [`Promise`]( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise )\<`T`\> It takes a map of auth data received from Telegram, and returns the data if it's valid @@ -172,7 +176,7 @@ It takes a map of auth data received from Telegram, and returns the data if it's #### Returns -[`Promise`]( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise )<`T`\> +[`Promise`]( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise )\<`T`\> The validated data. @@ -182,4 +186,4 @@ https://core.telegram.org/widgets/login#checking-authorization #### Defined in -[AuthDataValidator.ts:156](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/server/src/AuthDataValidator.ts#L156) +[AuthDataValidator.ts:156](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/server/src/AuthDataValidator.ts#L156) diff --git a/packages/server/docs/interfaces/AuthDataValidatorOptions.md b/packages/server/docs/interfaces/AuthDataValidatorOptions.md index 7fffa6e..58ca5d4 100644 --- a/packages/server/docs/interfaces/AuthDataValidatorOptions.md +++ b/packages/server/docs/interfaces/AuthDataValidatorOptions.md @@ -24,13 +24,13 @@ If you don't pass this here, you'll need to set it later using `setBotToken()`. #### Defined in -[AuthDataValidator.ts:10](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/server/src/AuthDataValidator.ts#L10) +[AuthDataValidator.ts:10](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/server/src/AuthDataValidator.ts#L10) ___ ### subtleCrypto -• `Optional` **subtleCrypto**: [`SubtleCrypto`]( https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto ) +• `Optional` **subtleCrypto**: [`SubtleCrypto`]( https://developer.mozilla.org/docs/Web/API/SubtleCrypto ) The crypto object to be used for validating the data @@ -40,19 +40,19 @@ https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto #### Defined in -[AuthDataValidator.ts:17](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/server/src/AuthDataValidator.ts#L17) +[AuthDataValidator.ts:17](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/server/src/AuthDataValidator.ts#L17) ___ ### encoder -• `Optional` **encoder**: [`TextEncoder`]( https://developer.mozilla.org/en-US/docs/Web/API/TextEncoder ) +• `Optional` **encoder**: [`TextEncoder`]( https://developer.mozilla.org/docs/Web/API/TextEncoder ) The encoder to be used for encoding the data #### Defined in -[AuthDataValidator.ts:22](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/server/src/AuthDataValidator.ts#L22) +[AuthDataValidator.ts:22](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/server/src/AuthDataValidator.ts#L22) ___ @@ -70,7 +70,7 @@ The time in seconds after which the data should be considered invalid #### Defined in -[AuthDataValidator.ts:29](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/server/src/AuthDataValidator.ts#L29) +[AuthDataValidator.ts:29](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/server/src/AuthDataValidator.ts#L29) ___ @@ -88,4 +88,4 @@ true #### Defined in -[AuthDataValidator.ts:36](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/server/src/AuthDataValidator.ts#L36) +[AuthDataValidator.ts:36](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/server/src/AuthDataValidator.ts#L36) diff --git a/packages/server/docs/interfaces/TelegramUserData.md b/packages/server/docs/interfaces/TelegramUserData.md index 3e624a3..a55e9b1 100644 --- a/packages/server/docs/interfaces/TelegramUserData.md +++ b/packages/server/docs/interfaces/TelegramUserData.md @@ -29,7 +29,7 @@ https://core.telegram.org/widgets/login#receiving-authorization-data #### Defined in -[utils/types.ts:12](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/server/src/utils/types.ts#L12) +[utils/types.ts:12](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/server/src/utils/types.ts#L12) ___ @@ -39,7 +39,7 @@ ___ #### Defined in -[utils/types.ts:13](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/server/src/utils/types.ts#L13) +[utils/types.ts:13](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/server/src/utils/types.ts#L13) ___ @@ -49,7 +49,7 @@ ___ #### Defined in -[utils/types.ts:14](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/server/src/utils/types.ts#L14) +[utils/types.ts:14](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/server/src/utils/types.ts#L14) ___ @@ -59,7 +59,7 @@ ___ #### Defined in -[utils/types.ts:15](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/server/src/utils/types.ts#L15) +[utils/types.ts:15](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/server/src/utils/types.ts#L15) ___ @@ -69,7 +69,7 @@ ___ #### Defined in -[utils/types.ts:16](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/server/src/utils/types.ts#L16) +[utils/types.ts:16](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/server/src/utils/types.ts#L16) ___ @@ -79,7 +79,7 @@ ___ #### Defined in -[utils/types.ts:18](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/server/src/utils/types.ts#L18) +[utils/types.ts:18](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/server/src/utils/types.ts#L18) ___ @@ -89,7 +89,7 @@ ___ #### Defined in -[utils/types.ts:19](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/server/src/utils/types.ts#L19) +[utils/types.ts:19](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/server/src/utils/types.ts#L19) ___ @@ -99,4 +99,4 @@ ___ #### Defined in -[utils/types.ts:20](https://github.com/manzoorwanijk/telegram-auth/blob/e5e86d3/packages/server/src/utils/types.ts#L20) +[utils/types.ts:20](https://github.com/manzoorwanijk/telegram-auth/blob/d84bbd25374d4a40c9b0166c23c16487f05d97de/packages/server/src/utils/types.ts#L20)