Skip to content
This repository has been archived by the owner on Dec 4, 2020. It is now read-only.

Commit

Permalink
Upgrade to Spark 6
Browse files Browse the repository at this point in the history
  • Loading branch information
cretueusebiu committed Feb 12, 2018
1 parent db47685 commit 5d53813
Show file tree
Hide file tree
Showing 13 changed files with 517 additions and 218 deletions.
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
root = true

[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false

[*.{vue,js,json,html,scss,blade.php}]
indent_style = space
indent_size = 2
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/vendor
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 2.0 - 2018-02-12

- Upgrade to Spark 6.

## 1.1.1 - 2017-03-19

- Added support for a custom Display Name in the authenticator app. ([#14](https://github.com/cretueusebiu/laravel-spark-google2fa/pull/14))
Expand Down
35 changes: 8 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,16 @@
# Google Authenticator support for Laravel Spark
# Google Authenticator for Laravel Spark 6

This package replaces the default Two-Factor Authentication driver with [Google Authenticator](https://support.google.com/accounts/answer/1066447?hl=en).
This package replaces the default two-factor authentication driver with [Google Authenticator](https://support.google.com/accounts/answer/1066447?hl=en).

![Demo](http://i.imgur.com/WQKx5nS.gif)

## Installation

- Run `composer require eusebiu/laravel-spark-google2fa`
- `composer require eusebiu/laravel-spark-google2fa`
- `php artisan vendor:publish --provider="Eusebiu\LaravelSparkGoogle2FA\Google2FAServiceProvider" --force`
- `php artisan migrate`
- `npm run dev`

- Add `Eusebiu\LaravelSparkGoogle2FA\Google2FAServiceProvider::class` to your `providers` array in `config/app.php` after `SparkServiceProvider`.
## Customization

- Run `php artisan config:clear`

- Run `php artisan vendor:publish --provider="Eusebiu\LaravelSparkGoogle2FA\Google2FAServiceProvider" --tag=migrations --tag=assets`

- Run `composer dumpautoload`

- Run `php artisan migrate`

- Edit `resources/views/vendor/spark/settings/security/enable-two-factor-auth.blade.php` and replace everything with `@include('google2fa::enable-two-factor-auth')`

- Edit `resources/assets/js/spark-components/settings/security/enable-two-factor-auth.js` and replace `require('settings/security/enable-two-factor-auth')` with `require('./enable-two-factor-auth-google')`

- Run `npm run dev`

## Customise the display name

The display name in the authenticator app is chosen from the ```$details``` section in your ```SparkServiceProvider``` file.

The following order is used, the first variable that's found will be the display name.

1. ```$details['2fa_name']``` (not present by default)
2. ```$details['vendor']``` (present by default)
3. the domain name (safe fallback)
To change the display name in the authenticator app, add `2fa_name` in your `SparkServiceProvider` file. By default `vendor` or the app url is used.
9 changes: 8 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,18 @@
"license": "MIT",
"type": "package",
"require": {
"pragmarx/google2fa": "^0.7.1"
"pragmarx/google2fa": "^2.0"
},
"autoload": {
"psr-4": {
"Eusebiu\\LaravelSparkGoogle2FA\\": "src/"
}
},
"extra": {
"laravel": {
"providers": [
"Eusebiu\\LaravelSparkGoogle2FA\\Google2FAServiceProvider"
]
}
}
}
297 changes: 297 additions & 0 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 5d53813

Please sign in to comment.