Skip to content
This repository has been archived by the owner on Feb 17, 2022. It is now read-only.

Commit

Permalink
Merge pull request #13 from DarkGhostHunter/master
Browse files Browse the repository at this point in the history
Adds support for Laravel 7
  • Loading branch information
DarkGhostHunter committed Mar 4, 2020
2 parents 9e8b91d + 81d6692 commit f1fc62d
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 14 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@ trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[*.yml]
indent_size = 2
8 changes: 8 additions & 0 deletions .github/workflows/composer-coveralls.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"require": {
"cedx/coveralls": "*"
},
"config": {
"vendor-dir": "vendor-coveralls"
}
}
30 changes: 24 additions & 6 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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

Expand All @@ -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
Expand All @@ -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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion src/TwoFactorAuthentication.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

/**
Expand Down

0 comments on commit f1fc62d

Please sign in to comment.