Skip to content

v3.0.0

Compare
Choose a tag to compare
@CrazyTapok-bit CrazyTapok-bit released this 08 Apr 17:00
· 53 commits to master since this release
5136366

Significant restructuring has been carried out on the TgWebValid class to improve security and usability. The class has been rewritten using the concept of data validation.

The isValid and isLoginValid methods have now been replaced with two new methods: validateInitData and validateLoginWidget. These methods take in input data, validate it, and return objects of the InitData and LoginWidget classes if the passed data is valid or a value of false if the data is invalid.

Additionally, new classes InitDataValidator and LoginWidgetValidator have been added, which are responsible for validating input data. These classes contain all the validation rules, as well as the corresponding methods that check whether the input data is valid.

Furthermore, some unnecessary fields have been removed from the TgWebValid class, specifically the initData and user fields. Instead, data is stored in InitData and LoginWidget objects.

As a result of these changes, the TgWebValid class has become more secure and convenient to use, as users can now verify the validity of input data before executing necessary operations and avoid encountering errors.