Skip to content

Commit

Permalink
First working version
Browse files Browse the repository at this point in the history
  • Loading branch information
emptynick committed Dec 7, 2021
1 parent ee120a8 commit df72c93
Show file tree
Hide file tree
Showing 17 changed files with 7,554 additions and 20 deletions.
Binary file added .github/assets/manage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/assets/warning.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
62 changes: 60 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,60 @@
# voyager-2fa
Two-factor-authentication for Voyager II
# Two-factor-authentication for Voyager II

This plugin for Voyager II uses [pragmarx/google2fa-laravel](https://github.com/antonioribeiro/google2fa-laravel) for two-factor-authentication.

## Installation

First, run `composer require emptynick/voyager-2fa`.
After that run `php artisan 2fa:install`.

This will:

1. Publish `pragmarx/google2fa-laravel` config file
2. Publish a migration to add a field named `google2fa_secret` to your `users` table
3. Migrate

You can skip publishing the config file and migrating.
This is helpful when you want to modify the migration file.

## Usage

By default, this plugin does not force you to use 2FA.
Whenever a 2FA code is assigned to a user, it will ask for it when logging-in.

### Activating 2FA for your account

Open the top-right user dropdown and click `Manage 2FA`.
There you will see a QR code and an input box.
Scan the QR code with your phone or enter the code manually and enter the generated OTP into the input.
Click `Enable` and the code will be stored.
Now, whenever you log-in, you'll be asked for a one-time-password.

![Warning](./.github/assets/manage.png)

### Disable 2FA

Clicking the `Disable` button will remove the OTP code from the database.
You are **not** required to enter an OTP when logging-in.
**This requires the setting `2FA.allow_disabling` to be `on`!**

### Renew 2FA code

When 2FA is active, you can simply renew the code. Proceed like described in `Activating 2FA for your account` and click on `Renew` instead of `Enable`!

## Settings

This plugin publishes some settings.

### 2FA.force_2fa

When active, this setting will prevent the user to open **any** page before setting-up 2FA. Defaults to false.

### 2FA.show_warning

Shows a warning whenever a page is opened and 2FA is **not** activated for the current user. Defaults to true.

![Warning](./.github/assets/warning.png)

### 2FA.allow_disabling

Allow users to disable two-factor-auth. Defaults to true.
7 changes: 6 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,17 @@
"Emptynick\\TwoFA\\": "src/"
}
},
"minimum-stability": "stable",
"minimum-stability": "dev",
"extra": {
"laravel": {
"providers": [
"Emptynick\\TwoFA\\TwoFAServiceProvider"
]
}
},
"require": {
"pragmarx/google2fa-laravel": "^2.0",
"bacon/bacon-qr-code": "^2.0",
"voyager-admin/voyager": "2.x-dev"
}
}
Loading

0 comments on commit df72c93

Please sign in to comment.