diff --git a/.editorconfig b/.editorconfig index cd8eb86..c451dda 100644 --- a/.editorconfig +++ b/.editorconfig @@ -13,3 +13,6 @@ trim_trailing_whitespace = true [*.md] trim_trailing_whitespace = false + +[*.yml] +indent_size = 2 diff --git a/.github/workflows/composer-coveralls.json b/.github/workflows/composer-coveralls.json new file mode 100644 index 0000000..7df94f2 --- /dev/null +++ b/.github/workflows/composer-coveralls.json @@ -0,0 +1,8 @@ +{ + "require": { + "cedx/coveralls": "*" + }, + "config": { + "vendor-dir": "vendor-coveralls" + } +} diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index f42decd..ed4703f 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -1,11 +1,26 @@ name: PHP Composer -on: [push] +on: + push: + pull_request: jobs: - build: + test: runs-on: ubuntu-latest + strategy: + fail-fast: true + matrix: + php: [7.4, 7.3, 7.2.15] + laravel: [7.*, 6.*] + dependency-version: [prefer-lowest, prefer-stable] + include: + - laravel: 7.* + testbench: 5.* + - laravel: 6.* + testbench: 4.* + + name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} steps: - name: Checkout @@ -14,7 +29,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v1 with: - php-version: '7.4' + php-version: ${{ matrix.php }} extensions: mbstring, intl coverage: xdebug @@ -26,11 +41,13 @@ jobs: uses: actions/cache@v1 with: path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} - restore-keys: ${{ runner.os }}-composer- + key: ${{ runner.os }}-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }} + restore-keys: ${{ runner.os }}-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer- - name: Install dependencies - run: composer install --prefer-dist --no-progress --no-suggest + run: | + composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-progress --no-update + composer update --${{ matrix.dependency-version }} --prefer-dist --no-progress --no-suggest - name: Run test suite run: composer run-script test @@ -40,5 +57,6 @@ jobs: COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} COVERALLS_SERVICE_NAME: github run: | + rm -rf composer.* vendor/ composer require cedx/coveralls vendor/bin/coveralls build/logs/clover.xml diff --git a/README.md b/README.md index 5b2cde3..84c058e 100644 --- a/README.md +++ b/README.md @@ -115,7 +115,7 @@ public function confirmTwoFactor(Request $request) } ``` -If the User doesn't issue the correct Code, the method will return `false`. You can tell the User to double-check its device's timezone, or create another Shared Secret with `confirmTwoFactorAuth()`. +If the User doesn't issue the correct Code, the method will return `false`. You can tell the User to double-check its device's timezone, or create another Shared Secret with `createTwoFactorAuth()`. ### Recovery Codes @@ -398,7 +398,7 @@ You can override the view, which handles the Two Factor Code verification for th The way it works is very simple: it will hold the User credentials in a hidden input while it asks for the Two Factor Code. The User will send everything again along with the Code, the application will ensure its correct, and complete the log in. -This view and its controller is bypassed if the User doesn't uses Two Factor Authentication, making the log in transparent and non-invasive. +This view and its form is bypassed if the User doesn't uses Two Factor Authentication, making the log in transparent and non-invasive. ## Security diff --git a/composer.json b/composer.json index 097c227..f50f18b 100644 --- a/composer.json +++ b/composer.json @@ -19,16 +19,16 @@ } ], "require": { - "php": "^7.2", + "php": "^7.2.15", "ext-json": "*", "bacon/bacon-qr-code": "2.*", "paragonie/constant_time_encoding": "2.*", - "illuminate/support": "^6.15", - "illuminate/auth": "^6.15" + "illuminate/support": "^6.15||^7.0", + "illuminate/auth": "^6.15||^7.0" }, "require-dev": { - "orchestra/testbench": "^4.0", - "orchestra/canvas": "^4.0", + "orchestra/testbench": "^4.0||^5.0", + "orchestra/canvas": "^4.0||5.0", "phpunit/phpunit": "^8.0" }, "autoload": { diff --git a/src/TwoFactorAuthentication.php b/src/TwoFactorAuthentication.php index b324456..badfbe5 100644 --- a/src/TwoFactorAuthentication.php +++ b/src/TwoFactorAuthentication.php @@ -18,7 +18,7 @@ trait TwoFactorAuthentication public function initializeTwoFactorAuthentication() { // For security, we will hide the Two Factor Authentication data from the parent model. - $this->addHidden('twoFactorAuth'); + $this->makeHidden('twoFactorAuth'); } /**