Skip to content

Commit 535752f

Browse files
committed
Merge branch 'release/1.3.1' into master
2 parents 5355309 + 7fb56ad commit 535752f

29 files changed

+2931
-1104
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
language: php
22

33
php:
4-
- 7.2
54
- 7.3
5+
- 7.4
66

77
before_script:
88
- cp .env.travis .env

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# 2FAuth
77
A web app to manage your Two-Factor Authentication (2FA) accounts and generate their security codes
88

9-
![screens](https://user-images.githubusercontent.com/858858/74479269-267a1600-4eaf-11ea-9281-415e5a54bd9f.png)
9+
![screens](https://user-images.githubusercontent.com/858858/95789691-47b13180-0cde-11eb-9d06-7c6d2ede5f3c.png)
1010

1111
#### [2FAuth Demo](https://demo.2fauth.app/)
1212

@@ -37,9 +37,9 @@ I created it because :
3737
2FAuth generates OTP according to RFC 4226 (HOTP Algorithm) and RFC 6238 (TOTP Algorithm) thanks to [Spomky-Labs/OTPHP](https://github.com/Spomky-Labs/otphp) php library.
3838

3939
## Requirements
40-
[![Requires PHP7](https://img.shields.io/badge/php-7.2.*-red.svg?style=flat-square)](https://secure.php.net/downloads.php)
41-
* See [Laravel server requirements](https://laravel.com/docs/5.8/installation#server-requirements)
42-
* Any database [supported by Laravel](https://laravel.com/docs/5.8/database)
40+
[![Requires PHP7](https://img.shields.io/badge/php-7.3.*-red.svg?style=flat-square)](https://secure.php.net/downloads.php)
41+
* See [Laravel server requirements](https://laravel.com/docs/7.x/installation#server-requirements)
42+
* Any database [supported by Laravel](https://laravel.com/docs/7.x/database)
4343

4444
## Installation (using command line)
4545

app/Console/Kernel.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,12 @@ class Kernel extends ConsoleKernel
2121
*
2222
* @param \Illuminate\Console\Scheduling\Schedule $schedule
2323
* @return void
24+
*
25+
* @codeCoverageIgnore Because no code will always remains Not Executed code
2426
*/
2527
protected function schedule(Schedule $schedule)
2628
{
27-
// $schedule->command('inspire')
28-
// ->hourly();
29+
//
2930
}
3031

3132
/**

app/Exceptions/Handler.php

+8-8
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace App\Exceptions;
44

5-
use Exception;
5+
use Throwable;
66
use Illuminate\Http\Response;
77
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
88
use Illuminate\Database\Eloquent\ModelNotFoundException as ModelNotFoundException;
@@ -33,10 +33,10 @@ class Handler extends ExceptionHandler
3333
/**
3434
* Report or log an exception.
3535
*
36-
* @param \Exception $exception
36+
* @param \Throwable $exception
3737
* @return void
3838
*/
39-
public function report(Exception $exception)
39+
public function report(Throwable $exception)
4040
{
4141
parent::report($exception);
4242
}
@@ -45,10 +45,10 @@ public function report(Exception $exception)
4545
* Render an exception into an HTTP response.
4646
*
4747
* @param \Illuminate\Http\Request $request
48-
* @param \Exception $exception
48+
* @param \Throwable $exception
4949
* @return \Illuminate\Http\Response
5050
*/
51-
public function render($request, Exception $exception)
51+
public function render($request, Throwable $exception)
5252
{
5353
if ( $request->wantsJson() ) {
5454

@@ -65,10 +65,10 @@ public function render($request, Exception $exception)
6565
* Render an exception into an HTTP response.
6666
*
6767
* @param \Illuminate\Http\Request $request
68-
* @param \Exception $exception
68+
* @param \Throwable $exception
6969
* @return \Illuminate\Http\JsonResponse
7070
*/
71-
private function handleApiException($request, Exception $exception)
71+
private function handleApiException($request, Throwable $exception)
7272
{
7373
$debug = [
7474
'exception' => get_class($exception),
@@ -96,7 +96,7 @@ private function handleApiException($request, Exception $exception)
9696
/**
9797
* Set a specific response payload for commons http error codes
9898
*
99-
* @param \Exception $exception
99+
* @param \Throwable $exception
100100
* @return \Illuminate\Http\JsonResponse
101101
*/
102102
private function customApiResponse($exception, $debug)

app/Http/Controllers/QrCodeController.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use Illuminate\Http\Request;
1212
use Illuminate\Support\Facades\Storage;
1313

14-
class QrCodecontroller extends Controller
14+
class QrCodeController extends Controller
1515
{
1616
/**
1717
* Handle uploaded qr code image

app/Http/Kernel.php

+1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ class Kernel extends HttpKernel
6363
'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
6464
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
6565
'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
66+
'AvoidResetPassword' => \App\Http\Middleware\AvoidPasswordResetInDemo::class,
6667
];
6768

6869
/**
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
3+
namespace App\Http\Middleware;
4+
5+
use Closure;
6+
use Illuminate\Http\Response;
7+
8+
class AvoidPasswordResetInDemo
9+
{
10+
/**
11+
* Handle an incoming request.
12+
*
13+
* @param \Illuminate\Http\Request $request
14+
* @param \Closure $next
15+
* @return mixed
16+
*/
17+
public function handle($request, Closure $next)
18+
{
19+
20+
if( config('app.options.isDemoApp') ) {
21+
return response()->json(['requestFailed' => __('auth.forms.no_reset_password_in_demo')], Response::HTTP_UNAUTHORIZED);
22+
}
23+
24+
return $next($request);
25+
}
26+
}

app/Providers/AppServiceProvider.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22

33
namespace App\Providers;
44

5+
use Illuminate\Support\Facades\Blade;
56
use Illuminate\Support\ServiceProvider;
67

8+
79
class AppServiceProvider extends ServiceProvider
810
{
911
/**
@@ -23,6 +25,6 @@ public function register()
2325
*/
2426
public function boot()
2527
{
26-
//
28+
Blade::withoutComponentTags();
2729
}
2830
}

changelog.md

+10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Change log
22

3+
## [1.3.1] - 2020-10-12
4+
5+
### Changed
6+
- Upgrade to Laravel 7.0
7+
- Drop PHP 7.2 support
8+
- Enable the Request reset password form in Demo mode but inactivated
9+
10+
### Fixed
11+
- Fix missing notifications in Auth views
12+
313
## [1.3.0] - 2020-10-09
414

515
### Added

composer.json

+17-17
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
11
{
2-
"name": "laravel/laravel",
2+
"name": "bubka/2fauth",
33
"type": "project",
4-
"description": "The Laravel Framework.",
4+
"description": "Two-Factor authentication generator",
55
"keywords": [
6-
"framework",
7-
"laravel"
6+
"2fauth",
7+
"two-actor authentication"
88
],
99
"license": "MIT",
1010
"require": {
11-
"php": "^7.1.3",
12-
"appstract/laravel-options": "^3.0",
11+
"php": "^7.3",
12+
"appstract/laravel-options": "^4.1.1",
1313
"doctrine/dbal": "^2.10",
14-
"fideloper/proxy": "^4.0",
14+
"fideloper/proxy": "^4.2",
1515
"khanamiryan/qrcode-detector-decoder": "^1.0",
16-
"laravel/framework": "5.8.*",
17-
"laravel/passport": "^7.2",
18-
"laravel/tinker": "^1.0",
19-
"spatie/eloquent-sortable": "^3.8",
16+
"laravel/framework": "^7.0",
17+
"laravel/passport": "^9.3.2",
18+
"laravel/tinker": "^2.0",
19+
"laravel/ui": "^2.0",
20+
"spatie/eloquent-sortable": "^3.9",
2021
"spomky-labs/otphp": "^10.0"
2122
},
2223
"require-dev": {
23-
"beyondcode/laravel-dump-server": "^1.0",
24-
"filp/whoops": "^2.0",
25-
"fzaninotto/faker": "^1.4",
26-
"mockery/mockery": "^1.0",
27-
"nunomaduro/collision": "^3.0",
28-
"phpunit/phpunit": "^7.5"
24+
"facade/ignition": "^2.3",
25+
"fzaninotto/faker": "^1.9",
26+
"mockery/mockery": "^1.3",
27+
"nunomaduro/collision": "^4.1",
28+
"phpunit/phpunit": "^9.3"
2929
},
3030
"config": {
3131
"optimize-autoloader": true,

0 commit comments

Comments
 (0)