Skip to content

Commit

Permalink
Merge pull request #11 from HijenHEK/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
HijenHEK authored Mar 31, 2024
2 parents 5786e32 + f0d5aeb commit e3c7265
Show file tree
Hide file tree
Showing 8 changed files with 1,885 additions and 1,581 deletions.
4 changes: 2 additions & 2 deletions app/Http/Controllers/Api/Authentication/MfaController.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ public function verify(Request $request)
abort_unless($request->user()->isMfaActive() , Response::HTTP_UNAUTHORIZED);

$data = $request->validate([
'code'=> 'required'
'code'=> 'required|string'
]);

$token = $request->user()->currentAccessToken();

abort_unless($token->mfa_code , Response::HTTP_UNAUTHORIZED);

abort_if($token->mfa_code != $data['code'] || now()->gt($token->mfa_expires_at), Response::HTTP_BAD_REQUEST , 'Invalid Code');
abort_if($token->mfa_code !== $data['code'] || now()->gt($token->mfa_expires_at), Response::HTTP_BAD_REQUEST , 'Invalid Code');

$token->mfa_code = null;
$token->mfa_expires_at = null;
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class Kernel extends HttpKernel
*
* @var array<string, class-string|string>
*/
protected $routeMiddleware = [
protected $middlewareAliases = [
'auth' => \App\Http\Middleware\Authenticate::class,
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
'auth.session' => \Illuminate\Session\Middleware\AuthenticateSession::class,
Expand Down
2 changes: 0 additions & 2 deletions app/Providers/AuthServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ class AuthServiceProvider extends ServiceProvider
*/
public function boot()
{
$this->registerPolicies();

ResetPassword::createUrlUsing(function ($user, string $token) {
return url('/api/reset-password?token='.$token);
});
Expand Down
14 changes: 7 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@
"keywords": ["framework", "laravel"],
"license": "MIT",
"require": {
"php": "^8.0.2",
"php": "^8.2",
"guzzlehttp/guzzle": "^7.2",
"laravel/framework": "^9.19",
"laravel/sanctum": "^2.14.1",
"laravel/framework": "^10.0",
"laravel/sanctum": "^3.2",
"laravel/tinker": "^2.7"
},
"require-dev": {
"fakerphp/faker": "^1.9.1",
"laravel/sail": "^1.0.1",
"mockery/mockery": "^1.4.4",
"nunomaduro/collision": "^6.1",
"phpunit/phpunit": "^9.5.10",
"spatie/laravel-ignition": "^1.0"
"nunomaduro/collision": "^7.0",
"phpunit/phpunit": "^10.0",
"spatie/laravel-ignition": "^2.0"
},
"autoload": {
"psr-4": {
Expand Down Expand Up @@ -56,6 +56,6 @@
"preferred-install": "dist",
"sort-packages": true
},
"minimum-stability": "dev",
"minimum-stability": "stable",
"prefer-stable": true
}
Loading

0 comments on commit e3c7265

Please sign in to comment.