mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fix for error in Authenticate.php
This commit is contained in:
parent
37a92fc853
commit
73a1c6a6e3
@ -18,7 +18,7 @@ class Authenticate {
|
||||
public function handle($request, Closure $next, $guard = 'user')
|
||||
{
|
||||
$authenticated = Auth::guard($guard)->check();
|
||||
|
||||
|
||||
if($guard=='client'){
|
||||
if(!empty($request->invitation_key)){
|
||||
$contact_key = session('contact_key');
|
||||
@ -33,7 +33,7 @@ class Authenticate {
|
||||
]);
|
||||
}
|
||||
|
||||
if ($contact->id != $invitation->contact_id) {
|
||||
if ($contact && $contact->id != $invitation->contact_id) {
|
||||
// This is a different client; reauthenticate
|
||||
$authenticated = false;
|
||||
Auth::guard($guard)->logout();
|
||||
@ -64,17 +64,17 @@ class Authenticate {
|
||||
// This is an admin; let them pretend to be a client
|
||||
$authenticated = true;
|
||||
}
|
||||
|
||||
|
||||
// Does this account require portal passwords?
|
||||
if($account && (!$account->enable_portal_password || !$account->hasFeature(FEATURE_CLIENT_PORTAL_PASSWORD))){
|
||||
$authenticated = true;
|
||||
}
|
||||
|
||||
|
||||
if(!$authenticated && $contact && !$contact->password){
|
||||
$authenticated = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!$authenticated)
|
||||
{
|
||||
if ($request->ajax())
|
||||
@ -89,7 +89,7 @@ class Authenticate {
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
|
||||
|
||||
protected function getInvitation($key){
|
||||
$invitation = Invitation::withTrashed()->where('invitation_key', '=', $key)->first();
|
||||
if ($invitation && !$invitation->is_deleted) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user