mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-03 10:54:34 -04:00
Fixes for correct redirects
This commit is contained in:
parent
77561bd398
commit
d5ad8c8773
@ -126,8 +126,8 @@ class ResetPasswordController extends Controller
|
|||||||
return new JsonResponse(['message' => trans($response)], 200);
|
return new JsonResponse(['message' => trans($response)], 200);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(Ninja::isHosted() && $request->hasHeader('X-React')){
|
if($request->hasHeader('X-React')){
|
||||||
return redirect('https://app.invoicing.co/#/login');
|
return redirect(config('ninja.react_url').'/#/login');
|
||||||
}
|
}
|
||||||
elseif($request->hasHeader('X-React'))
|
elseif($request->hasHeader('X-React'))
|
||||||
return redirect('/#/login');
|
return redirect('/#/login');
|
||||||
|
@ -42,7 +42,6 @@ trait VerifiesUserEmail
|
|||||||
}
|
}
|
||||||
|
|
||||||
$user->email_verified_at = now();
|
$user->email_verified_at = now();
|
||||||
// $user->confirmation_code = null; //this prevented the form from showing validation errors.
|
|
||||||
$user->save();
|
$user->save();
|
||||||
|
|
||||||
if (isset($user->oauth_user_id)) {
|
if (isset($user->oauth_user_id)) {
|
||||||
@ -69,7 +68,6 @@ trait VerifiesUserEmail
|
|||||||
$user = User::where('id', $this->decodePrimaryKey(request()->user_id))->firstOrFail();
|
$user = User::where('id', $this->decodePrimaryKey(request()->user_id))->firstOrFail();
|
||||||
|
|
||||||
$validator = Validator::make(request()->all(), [
|
$validator = Validator::make(request()->all(), [
|
||||||
//'password' => ['required', 'min:6'],
|
|
||||||
'password' => 'min:6|required_with:password_confirmation|same:password_confirmation',
|
'password' => 'min:6|required_with:password_confirmation|same:password_confirmation',
|
||||||
'password_confirmation' => 'min:6'
|
'password_confirmation' => 'min:6'
|
||||||
]);
|
]);
|
||||||
|
@ -11,6 +11,8 @@
|
|||||||
|
|
||||||
namespace App\Mail\Admin;
|
namespace App\Mail\Admin;
|
||||||
|
|
||||||
|
use App\Models\Company;
|
||||||
|
use App\Models\User;
|
||||||
use App\Utils\Ninja;
|
use App\Utils\Ninja;
|
||||||
use App\Utils\Traits\MakesHash;
|
use App\Utils\Traits\MakesHash;
|
||||||
use Illuminate\Support\Facades\App;
|
use Illuminate\Support\Facades\App;
|
||||||
@ -19,14 +21,8 @@ class VerifyUserObject
|
|||||||
{
|
{
|
||||||
use MakesHash;
|
use MakesHash;
|
||||||
|
|
||||||
public $user;
|
public function __construct(public User $user, public Company $company, private bool $is_react = false)
|
||||||
|
|
||||||
public $company;
|
|
||||||
|
|
||||||
public function __construct($user, $company)
|
|
||||||
{
|
{
|
||||||
$this->user = $user;
|
|
||||||
$this->company = $company;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function build()
|
public function build()
|
||||||
@ -44,7 +40,7 @@ class VerifyUserObject
|
|||||||
|
|
||||||
$react_redirect = '';
|
$react_redirect = '';
|
||||||
|
|
||||||
if(Ninja::isHosted()) {
|
if($this->is_react) {
|
||||||
$react_redirect = '?react=true';
|
$react_redirect = '?react=true';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,18 +20,18 @@ use App\Utils\Ninja;
|
|||||||
|
|
||||||
class UserService
|
class UserService
|
||||||
{
|
{
|
||||||
public $user;
|
public function __construct(public User $user)
|
||||||
|
|
||||||
public function __construct(User $user)
|
|
||||||
{
|
{
|
||||||
$this->user = $user;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function invite($company)
|
public function invite($company)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
$is_react = request()->hasHeader('X-REACT') ?? false;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$nmo = new NinjaMailerObject;
|
$nmo = new NinjaMailerObject;
|
||||||
$nmo->mailable = new NinjaMailer((new VerifyUserObject($this->user, $company))->build());
|
$nmo->mailable = new NinjaMailer((new VerifyUserObject($this->user, $company, $is_react))->build());
|
||||||
$nmo->company = $company;
|
$nmo->company = $company;
|
||||||
$nmo->to_user = $this->user;
|
$nmo->to_user = $this->user;
|
||||||
$nmo->settings = $company->settings;
|
$nmo->settings = $company->settings;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user