Releases: michaeldzjap/laravel-two-factor-authentication
Version 2.5.1 of laravel-two-factor-authentication
Changed
- It is now possible to use a custom
User
model if you wish. Instead of specifying properties of theUser
model in the config file you now actually specify the model that should be used. This defaults to\App\User::class
. This is somewhat of a breaking change in that you will have to modify your published config file. See the updated config file for reference.
Version 2.5.0 of laravel-two-factor-authentication
Added
- Support for Laravel 6.0
Version 2.4.1 of laravel-two-factor-authentication
Added
- A new convenience method
$user->getMobile()
has been added (PR #4). By default this is just returning$user->mobile
. However, it is possible to override this with your own logic, for instance you could use a relation for the mobile phone number of a user instead of the more simplemobile
column onUser
that this package uses by default. For normal uses cases, no changes are required. However, if you implement your own provider or are overridingMessageBirdVerify#sendSMSToken
you might want to replace any$user->mobile
calls with$user->getMobile()
.
Version 2.4.0 of laravel-two-factor-authentication
Changed
- It is now possible to enable / disable 2fa for all users in addition to enabling / disabling it on a per user level. This can be specified in the config.
- You now more easily use this package if your user model uses a custom primary key. Just specify your custom primary key in the models section of the config.
Breaking
- The migration files for this package are now published. This allows for more flexibility. However, it also could cause complications when migrations for this package have already been ran. Please go here for advice.
- More strict function type hinting has been added. This largely should be of no concern, except if you are overriding certain functionality or have implemented custom providers.
Special thanks to @kim-dongit for implementing most of these new additions.
Version 2.3.0 of laravel-two-factor-authentication
Changed
- Laravel 5.8 has changed the type signature of the
id
column on theusers
table. To learn what this means in terms of using this package, please see this.
Features
- Support for Laravel 5.8 has been added.
- A new config option "big_int" has been added. Use this option to select which type (i.e.
unsignedBigInteger
orunsignedInteger
) to use for theuser_id
column on thetwo_factor_auths
table. See this for more information.
Version 2.2.0 of laravel-two-factor-authentication
Features
- It is now possible to perform an additional action after the user has completed the two-factor authentication sequence successfully. This works identical to how Laravel handles this after login. In order to do this override the
authenticated
method of theTwoFactorAuthenticatesUsers
trait in yourTwoFactorAuthController
:
class TwoFactorAuthController extends Controller
{
...
/**
* The user has been two-factor authenticated.
*
* @param \Illuminate\Http\Request $request
* @param mixed
* @return mixed
*/
protected function authenticated(Request $request, $user)
{
// Optionally do something after two-factor authentication is completed...
}
}
- A
TwoFactorAuthenticated
event now is fired after two-factor authentication completes. This is passed in the logged in user for convenience. - An example project has been added. This serves both as a reference for how to set up this package in your own project and as a test suite.
- The published blade views have been updated to improve compatibility with the latest Bootstrap 4 version.
Version 2.1.4 release
Features
Make laravel-two-factor-authentication compatible with Laravel v5.7.
Version 2.1.3 release
Features
It is now possible to configure the routes yourself. Previously the route URL's and route name (in case of the GET route) where hardcoded. Now they can be customised from the config file if one so desires.
Version 2.1.2 release
Changed
- Use the correct HTTP error code when sending a lockout response (see this). This is a breaking change, but since Laravel is patching this, so will we.
Version 2.1.0 release
Because the TwoFactorAuthManager
class now inherits from Illuminate\Support\Manager
it is possible to use your own custom provider.
To do so your provider needs to implement MichaelDzjap\TwoFactorAuth\Contracts\TwoFactorProvider
(and possibly MichaelDzjap\TwoFactorAuth\Contracts\SMSToken
if you want to send the authentication token via SMS).
Assuming the name of your custom provider is 'dummy', it can then be registered with TwoFactorAuthManager
:
resolve(\MichaelDzjap\TwoFactorAuth\TwoFactorAuthManager)->extend('dummy', function ($app) {
return new DummyProvider;
});
You should also add an entry for you custom provider in the 'provider' array in app/config/twofactor-auth.php:
'dummy' => [
'driver' => 'dummy',
],
And lastly, don't forget to change the name of the provider in your .env:
TWO_FACTOR_AUTH_DRIVER=dummy