teckwei1993 / laravel-otp Goto Github PK
View Code? Open in Web Editor NEWA package for Laravel One Time Password (OTP) generator and validation without Eloquent Model, since it done by Cache.
A package for Laravel One Time Password (OTP) generator and validation without Eloquent Model, since it done by Cache.
I'm using the latest Laravel release (10.45.1) and the latests version of this package.
I received complaints from my users that the otp code is not valid even when they enter the exact code that they received.
After investigating, I found that the otp request data can't be found in the cache after 45 seconds. Without data, the code is invalid.
By default, the cache is valid for 15 minutes but when the otp data are stored in the cache, the data are only stored for 45 seconds because app()->version() >= "5.8"
is not true anymore.
private function writeData(string $key, $value)
{
$expires = $this->expires;
if(app()->version() >= "5.8"){
$expires *= 60;
}
return Cache::put($this->prefix.$key, $value, $expires*3);
}
This was introduced 3 years ago in version 1.0.5 to support older version of Laravel.
I think that now, it is safe to remove support for those version and come back to
private function writeData(string $key, $value)
{
return Cache::put($this->prefix.$key, $value, $this->expires*60*3);
}
or use the opposite logic to support older version ...
Is your feature request related to a problem? Please describe.
When i try to upgrade to laravel 10 composer complaints about illuminate/support
Describe the solution you'd like
This should fix the issue
"illuminate/support": "^5.2|^6.0|^7.0|^8.0|^9.0|^10.0"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.