-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
2FA Two Authentication Factor #164 #724
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Alexis Saettler <[email protected]>
Signed-off-by: Alexis Saettler <[email protected]>
Signed-off-by: Alexis Saettler <[email protected]>
Signed-off-by: Alexis Saettler <[email protected]>
Signed-off-by: Alexis Saettler <[email protected]>
Signed-off-by: Alexis Saettler <[email protected]>
Signed-off-by: Alexis Saettler <[email protected]>
Signed-off-by: Alexis Saettler <[email protected]>
djaiss
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent work, it works on my machine so far. I've added a few comments.
Also, don't forget the localization as well!
Finally, what do you think of moving both 2FA and password change to a new Security tab under Settings?
| {{ csrf_field() }} | ||
|
|
||
| @if ($errors->has('totp')) | ||
| <span class="help-block"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation seems off here.
| @endif | ||
| <div class="form-group"> | ||
| <label for="one_time_password">Enter code</label> | ||
| <input type="number" class="form-control" id="one_time_password" name="one_time_password" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could put required here, to enable browser validation of the field.
| </div> | ||
|
|
||
| <div class="form-group actions"> | ||
| <button type="submit" class="btn btn-primary">Validate</button> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be nice to provide a Cancel button here to let users go back to the Login screen.
| {{-- code --}} | ||
| <div class="form-group"> | ||
| <label for="one_time_password">Enter code</label> | ||
| <input type="number" class="form-control" id="one_time_password" name="one_time_password" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can add required parameter here a well.
| AWS_BUCKET= | ||
| AWS_SERVER= | ||
|
|
||
| 2FA_ENABLED=false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a comment here on what 2FA is and does?
…, indentation, etc) Signed-off-by: Alexis Saettler <[email protected]>
Signed-off-by: Alexis Saettler <[email protected]>
Signed-off-by: Alexis Saettler <[email protected]>
Signed-off-by: Alexis Saettler <[email protected]>
Signed-off-by: Alexis Saettler <[email protected]>
…to 164-2FA-two-factor-auth
| public function up() | ||
| { | ||
| Schema::table('users', function ($table) { | ||
| $table->string('google2fa_secret')->nullable(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you put $table->string('google2fa_secret')->after('remember_token')->nullable(); instead?
That way, the new field won't be at the latest position in the table.
| $user = $request->user(); | ||
|
|
||
| //generate image for QR barcode | ||
| $imageDataUri = Google2FA::getQRCodeInline( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if it's an issue, but static analysis says that this is an instance method, called statically
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, we should use app('pragmarx.google2fa')->getQRCodeInline instead.
Thanks !
Do you want to open an issue ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or just add it to the (great) PR #878
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have added
|
This pull request has been automatically locked since there |


This will close #164
Based on my fork of pragmarx/google2fa-laravel, see https://github.com/asbiin/google2fa-laravel
Be careful to update the time of the machine/VM to make it works :
Option is not activated by default, update your .env to add
2FA_ENABLED=trueThis is a 1st release, which can:
Still need to do :