In the captcha tokens edit page, a new section has been added to provide instructions for integrating the captcha code in user's website. This aims to facilitate ease of integration for users, by providing them a readily available code snippet.
Fixed a typo in the 'user_agent' variable of the 'GetCaptchaKeyInfo' object in swagger.json. This was important to rectify in order to achieve accuracy and prevent potential errors during API documentation generation.
The commit fixes an issue where wrong variable was passed as second argument to randomSymbols method. Previously it was using an uninitialized variable 'fakes' which was supposed to be populated by 'success' variable. The 'success' variable already has the set of valid symbols which should be used to generate fake symbols for captcha.
The dimensions for both the 'image_head' and 'image_body' captcha images have been increased to provide a clearer and more readable captcha for users. 'Image_head' has been updated from 150x40 to 500x75, and 'image_body' from 300x240 to 500x500.
This commit adds 'CaptchaToken' key to both English and Russian versions of the permissions language files. The addition of the 'CaptchaToken' key was necessary to provide translations for tokens used in captcha creation. The lack of these labels was causing readability issues in UI.
Added a new CryptographyContract interface and CryptographyString class that implements this contract. The CryptographyContract encapsulates the encryption and decryption of strings, enforcing these operations to be standardized across the application. The CryptographyString class uses Laravel's native crypt facades to perform these actions. In the AppServiceProvider, CryptographyContract is now bound to CryptographyString class, allowing the container to automatically resolve the dependencies wherever the interface is type hinted.
The lines setting up volumes for the 'swagger' service were commented out and redundant, leading to potential confusion. This commit removes those lines to clean up and simplify the file.
In our Swagger API documentation, the parameter names 'public_token' and 'private_token' have been renamed to match our established naming conventions. The hyphenated form ('public-token' and 'private-token') is more consistent with other parameters.
The "servers" section was deleted and the "/api/v1" part was added to "paths" values for a more refined URL structure. This change makes it more clear that the API version is part of the API route.
Added Swagger as a new service in the docker-compose file for generating the API documentation. The new API documentation is provided via an OpenAPI file located at `public/swagger.json`. Changes in routing were done to handle /api-docs requests and redirect them to the running Swagger UI instance. This will make API easier to understand and debug.
The Role class in app/Models has been refactored to improve readability and maintainability. The 'slug' field was replaced with 'code' for consistency with the rest of the codebase. In addition, the 'isRemove' and 'isAdmin' methods were rewritten using new 'Attribute' Eloquent cast. This refactor enhances the code's clarity, promotes better comprehension, and clears redundant code comments.
Changed the error check in the AuthController from checking if the result is not successful to checking if the result has an error. This change was made to clarify the code and ensure that errors are handled properly.