@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | * |
45 | 45 | * @param \Illuminate\Http\Request |
46 | 46 | * |
47 | - * @return \Illuminate\Http\Response |
|
47 | + * @return \Illuminate\Http\RedirectResponse |
|
48 | 48 | */ |
49 | 49 | public function enableTwoFactorAuthentication(Request $request) |
50 | 50 | { |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | * |
84 | 84 | * @param int $length Length of the encoded string. |
85 | 85 | * |
86 | - * @return void |
|
86 | + * @return string |
|
87 | 87 | */ |
88 | 88 | private function base32EncodedString($length = 30): |
89 | 89 | string |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -Route::group(['middleware' => ['web'], 'namespace' => '\Thecodework\TwoFactorAuthentication\Http\Controllers'], function () { |
|
3 | +Route::group(['middleware' => ['web'], 'namespace' => '\Thecodework\TwoFactorAuthentication\Http\Controllers'], function() { |
|
4 | 4 | Route::get('verify-2fa', 'TwoFactorAuthenticationController@verifyTwoFactorAuthentication'); |
5 | 5 | Route::post('verify-2fa', 'TwoFactorAuthenticationController@verifyToken'); |
6 | 6 | Route::get('setup-2fa', 'TwoFactorAuthenticationController@setupTwoFactorAuthentication'); |
@@ -58,7 +58,7 @@ |
||
58 | 58 | ]; |
59 | 59 | |
60 | 60 | // Impllicitly adding an validation rule to check if token is valid or not. |
61 | - Validator::extendImplicit('valid_token', function ($attribute, $value, $parameters, $validator) { |
|
61 | + Validator::extendImplicit('valid_token', function($attribute, $value, $parameters, $validator) { |
|
62 | 62 | $totp = new TOTP( |
63 | 63 | config('2fa-config.account_name'), |
64 | 64 | $this->user->secret_key |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | */ |
14 | 14 | public function up() |
15 | 15 | { |
16 | - Schema::table('users', function (Blueprint $table) { |
|
16 | + Schema::table('users', function(Blueprint $table) { |
|
17 | 17 | $table->smallInteger('is_2fa_enabled')->default(0)->before('create_at'); |
18 | 18 | $table->string('secret_key')->nullable()->after('is_2fa_enabled'); |
19 | 19 | }); |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | */ |
27 | 27 | public function down() |
28 | 28 | { |
29 | - Schema::table('users', function (Blueprint $table) { |
|
29 | + Schema::table('users', function(Blueprint $table) { |
|
30 | 30 | $table->dropColumn('is_2fa_enabled'); |
31 | 31 | $table->dropColumn('secret_key'); |
32 | 32 | }); |