Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shahsawood #26

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

shahsawoodshinwari
Copy link

@shahsawoodshinwari shahsawoodshinwari commented Dec 29, 2023

Pull Request Description

This pull request introduces the following changes:

  1. Refactored the hard-coded configuration of validity duration and the length of the token. Now, these configurations are set up in config/ichtrojan-otp.php to allow easy customization for a project. This change ensures that the length and duration of OTP remain configurable at the project level.

  2. Refactored validation messages to be retrieved from translation files, enhancing support for localization. To implement this, users are advised to set validation keys in validation.php. Add the following entries to your validation.php file:

    'ichtrojan_otp' => [
        'expired' => 'OTP Expired',
        'valid' => 'OTP is valid',
        'invalid' => 'OTP is not valid',
        'not_exist' => 'OTP does not exist'
    ],

    These entries will allow users to customize the validation messages for the package according to their needs.

Please review and merge these changes at your earliest convenience. If there are any further adjustments needed or if you have questions, feel free to let me know.

Comment on lines +1 to +13
<?php

return [
/**
* The length of the token
*/
'length' => 4,

/**
* The validity of the token in minutes
*/
'validity' => 10,
];
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename file to otp.php

add the validation messages in here too

Copy link
Owner

@ichtrojan ichtrojan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a comment, please include a readme update

@ichtrojan ichtrojan mentioned this pull request Dec 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants