mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-05 03:04:36 -04:00
commit
2a89a12b69
@ -171,7 +171,7 @@ class LoginController extends BaseController
|
|||||||
|
|
||||||
//if user has 2fa enabled - lets check this now:
|
//if user has 2fa enabled - lets check this now:
|
||||||
|
|
||||||
if($user->google_2fa_secret)
|
if($user->google_2fa_secret && $request->has('one_time_password'))
|
||||||
{
|
{
|
||||||
$google2fa = new Google2FA();
|
$google2fa = new Google2FA();
|
||||||
|
|
||||||
@ -184,6 +184,13 @@ class LoginController extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
elseif($user->google_2fa_secret && !$request->has('one_time_password')) {
|
||||||
|
|
||||||
|
return response()
|
||||||
|
->json(['message' => ctrans('texts.invalid_one_time_password')], 401)
|
||||||
|
->header('X-App-Version', config('ninja.app_version'))
|
||||||
|
->header('X-Api-Version', config('ninja.minimum_client_version'));
|
||||||
|
}
|
||||||
|
|
||||||
$user->setCompany($user->account->default_company);
|
$user->setCompany($user->account->default_company);
|
||||||
$timeout = auth()->user()->company()->default_password_timeout;
|
$timeout = auth()->user()->company()->default_password_timeout;
|
||||||
|
@ -56,6 +56,7 @@ class TwoFactorController extends BaseController
|
|||||||
if($google2fa->verifyKey($secret, $oneTimePassword) && $user->phone && $user->email_verified_at){
|
if($google2fa->verifyKey($secret, $oneTimePassword) && $user->phone && $user->email_verified_at){
|
||||||
|
|
||||||
$user->google_2fa_secret = encrypt($secret);
|
$user->google_2fa_secret = encrypt($secret);
|
||||||
|
|
||||||
$user->save();
|
$user->save();
|
||||||
|
|
||||||
return response()->json(['message' => ctrans('texts.enabled_two_factor')], 200);
|
return response()->json(['message' => ctrans('texts.enabled_two_factor')], 200);
|
||||||
|
@ -21,9 +21,6 @@ class NinjaPdf
|
|||||||
public function build($html)
|
public function build($html)
|
||||||
{
|
{
|
||||||
|
|
||||||
nlog("building remotely");
|
|
||||||
|
|
||||||
|
|
||||||
$client = new \GuzzleHttp\Client(['headers' =>
|
$client = new \GuzzleHttp\Client(['headers' =>
|
||||||
[
|
[
|
||||||
'X-Ninja-Token' => 'test_token_for_now',
|
'X-Ninja-Token' => 'test_token_for_now',
|
||||||
|
@ -0,0 +1,30 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
class Change2faColumnFromVarcharToText extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::table('users', function (Blueprint $table) {
|
||||||
|
$table->text('google_2fa_secret')->change();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user