-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implement laravel jetstream and fortify (#671)
- Loading branch information
Showing
64 changed files
with
3,212 additions
and
947 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
|
||
namespace App\Providers; | ||
|
||
use Illuminate\Http\Request; | ||
use Laravel\Fortify\Fortify; | ||
use App\Services\User\CreateAccount; | ||
use Illuminate\Support\ServiceProvider; | ||
use App\Services\User\ResetUserPassword; | ||
use Illuminate\Cache\RateLimiting\Limit; | ||
use App\Services\User\UpdateUserPassword; | ||
use Illuminate\Support\Facades\RateLimiter; | ||
use App\Services\User\UpdateUserProfileInformation; | ||
|
||
class FortifyServiceProvider extends ServiceProvider | ||
{ | ||
/** | ||
* Register any application services. | ||
*/ | ||
public function register() | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Bootstrap any application services. | ||
*/ | ||
public function boot() | ||
{ | ||
Fortify::createUsersUsing(CreateAccount::class); | ||
Fortify::updateUserProfileInformationUsing(UpdateUserProfileInformation::class); | ||
Fortify::updateUserPasswordsUsing(UpdateUserPassword::class); | ||
Fortify::resetUserPasswordsUsing(ResetUserPassword::class); | ||
|
||
RateLimiter::for('login', function (Request $request) { | ||
return Limit::perMinute(5)->by($request->email.$request->ip()); | ||
}); | ||
|
||
RateLimiter::for('two-factor', function (Request $request) { | ||
return Limit::perMinute(5)->by($request->session()->get('login.id')); | ||
}); | ||
} | ||
} |
Oops, something went wrong.