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

Feat: Added verify method to just verify OTP for custom use cases #11

Closed

Conversation

iamarpitpatidar
Copy link

Why ?

  • I have country_code and mobile in different columns
  • Now current validate method doesn't work coz without country_code I can't use my app and with country_code it throws error that user not found.
  • for these custom cases I've created a new verify method which just verify OTP and return bool.

Is it a breaking change ?

No

@mohammad-fouladgar
Copy link
Owner

If I'm not mistaken, you only need to verify(confirm) the token. If I were you, I would add a method like onlyConfirmToken() for more code readability and interactivity and use the below code:

 public function onlyConfirmToken(bool $confirm = true): static
 {
     $this->onlyConfirm = $confirm;

     return $this;
 }

//--------- usage------------
OTP()->onlyConfirmToken()->validate('mobile','token');

Anyway, Please write a test for this PR. Thanks.

@iamarpitpatidar
Copy link
Author

iamarpitpatidar commented Sep 9, 2023 via email

@iamarpitpatidar
Copy link
Author

iamarpitpatidar commented Sep 9, 2023 via email

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