mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -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);
|
||||
}
|
||||
|
||||
if(Ninja::isHosted() && $request->hasHeader('X-React')){
|
||||
return redirect('https://app.invoicing.co/#/login');
|
||||
if($request->hasHeader('X-React')){
|
||||
return redirect(config('ninja.react_url').'/#/login');
|
||||
}
|
||||
elseif($request->hasHeader('X-React'))
|
||||
return redirect('/#/login');
|
||||
|
@ -42,7 +42,6 @@ trait VerifiesUserEmail
|
||||
}
|
||||
|
||||
$user->email_verified_at = now();
|
||||
// $user->confirmation_code = null; //this prevented the form from showing validation errors.
|
||||
$user->save();
|
||||
|
||||
if (isset($user->oauth_user_id)) {
|
||||
@ -69,7 +68,6 @@ trait VerifiesUserEmail
|
||||
$user = User::where('id', $this->decodePrimaryKey(request()->user_id))->firstOrFail();
|
||||
|
||||
$validator = Validator::make(request()->all(), [
|
||||
//'password' => ['required', 'min:6'],
|
||||
'password' => 'min:6|required_with:password_confirmation|same:password_confirmation',
|
||||
'password_confirmation' => 'min:6'
|
||||
]);
|
||||
|
@ -11,6 +11,8 @@
|
||||
|
||||
namespace App\Mail\Admin;
|
||||
|
||||
use App\Models\Company;
|
||||
use App\Models\User;
|
||||
use App\Utils\Ninja;
|
||||
use App\Utils\Traits\MakesHash;
|
||||
use Illuminate\Support\Facades\App;
|
||||
@ -19,14 +21,8 @@ class VerifyUserObject
|
||||
{
|
||||
use MakesHash;
|
||||
|
||||
public $user;
|
||||
|
||||
public $company;
|
||||
|
||||
public function __construct($user, $company)
|
||||
public function __construct(public User $user, public Company $company, private bool $is_react = false)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->company = $company;
|
||||
}
|
||||
|
||||
public function build()
|
||||
@ -44,7 +40,7 @@ class VerifyUserObject
|
||||
|
||||
$react_redirect = '';
|
||||
|
||||
if(Ninja::isHosted()) {
|
||||
if($this->is_react) {
|
||||
$react_redirect = '?react=true';
|
||||
}
|
||||
|
||||
|
@ -20,18 +20,18 @@ use App\Utils\Ninja;
|
||||
|
||||
class UserService
|
||||
{
|
||||
public $user;
|
||||
|
||||
public function __construct(User $user)
|
||||
public function __construct(public User $user)
|
||||
{
|
||||
$this->user = $user;
|
||||
}
|
||||
|
||||
public function invite($company)
|
||||
{
|
||||
|
||||
$is_react = request()->hasHeader('X-REACT') ?? false;
|
||||
|
||||
try {
|
||||
$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->to_user = $this->user;
|
||||
$nmo->settings = $company->settings;
|
||||
|
Loading…
x
Reference in New Issue
Block a user