Vendor Contact key login

This commit is contained in:
David Bomba 2022-08-04 16:30:11 +10:00
parent 92c236e788
commit b9c198f38e
4 changed files with 6 additions and 4 deletions

View File

@ -12,6 +12,7 @@
namespace App\Factory; namespace App\Factory;
use App\Models\VendorContact; use App\Models\VendorContact;
use Illuminate\Support\Str;
class VendorContactFactory class VendorContactFactory
{ {
@ -21,6 +22,7 @@ class VendorContactFactory
$vendor_contact->first_name = ''; $vendor_contact->first_name = '';
$vendor_contact->user_id = $user_id; $vendor_contact->user_id = $user_id;
$vendor_contact->company_id = $company_id; $vendor_contact->company_id = $company_id;
$vendor_contact->contact_key = Str::random(40);
$vendor_contact->id = 0; $vendor_contact->id = 0;
return $vendor_contact; return $vendor_contact;

View File

@ -149,7 +149,7 @@ class VendorContactKeyLogin
private function setRedirectPath() private function setRedirectPath()
{ {
return 'vendors/purchase_orders'; return 'vendor/purchase_orders';
} }
} }

View File

@ -160,7 +160,7 @@ class VendorContact extends Authenticatable implements HasLocalePreference
$domain = isset($this->company->portal_domain) ? $this->company->portal_domain : $this->company->domain(); $domain = isset($this->company->portal_domain) ? $this->company->portal_domain : $this->company->domain();
return $domain.'/vendors/key_login/'.$this->contact_key; return $domain.'/vendor/key_login/'.$this->contact_key;
} }
} }

View File

@ -19,7 +19,7 @@ use App\Http\Controllers\VendorPortal\VendorContactHashLoginController;
use Illuminate\Support\Facades\Route; use Illuminate\Support\Facades\Route;
Route::get('vendors', [VendorContactLoginController::class, 'catch'])->name('vendor.catchall')->middleware(['domain_db', 'contact_account','vendor_locale']); //catch all Route::get('vendors', [VendorContactLoginController::class, 'catch'])->name('vendor.catchall')->middleware(['domain_db', 'contact_account','vendor_locale']); //catch all
Route::get('vendor/key_login/{contact_key}', [VendorContactHashLoginController::class, 'login'])->name('contact_login')->middleware(['domain_db','contact_key_login']); Route::get('vendor/key_login/{contact_key}', [VendorContactHashLoginController::class, 'login'])->name('contact_login')->middleware(['domain_db','vendor_contact_key_login']);
Route::group(['middleware' => ['invite_db'], 'prefix' => 'vendor', 'as' => 'vendor.'], function () { Route::group(['middleware' => ['invite_db'], 'prefix' => 'vendor', 'as' => 'vendor.'], function () {
/*Invitation catches*/ /*Invitation catches*/