Working on improving hosted migration experience

This commit is contained in:
David Bomba 2021-07-17 17:38:59 +10:00
parent a38dcbdd87
commit 8554c6cceb
3 changed files with 4 additions and 5 deletions

View File

@ -21,6 +21,7 @@ class HostedMigrationController extends Controller
public function getAccount(Request $request)
{
if($request->header('X-API-HOSTED-SECRET') != config('ninja.ninja_hosted_secret'))
return;
@ -32,8 +33,7 @@ class HostedMigrationController extends Controller
return response()->json(['token' => $user->account->companies->first()->tokens->first()->token] ,200);
}
return response()->json(['error' => 'This user is not able to perform a migration. Please contact us at contact@invoiceninja.com to discuss.'], 401)
return response()->json(['error' => 'This user is not able to perform a migration. Please contact us at contact@invoiceninja.com to discuss.'], 401);
}

View File

@ -58,7 +58,7 @@ class CreateUser
{
$user = new User();
$user->account_id = $this->account->id;
$user->password = bcrypt($this->request['password']);
$user->password = $this->request['password'] ? bcrypt($this->request['password']) : '';
$user->accepted_terms_version = config('ninja.terms_version');
$user->confirmation_code = $this->createDbHash(config('database.default'));
$user->fill($this->request);

View File

@ -205,7 +205,6 @@ Route::match(['get', 'post'], 'payment_notification_webhook/{company_key}/{compa
Route::post('api/v1/postmark_webhook', 'PostMarkController@webhook');
Route::get('token_hash_router', 'OneTimeTokenController@router');
Route::get('webcron', 'WebCronController@index');
Route::post('api/v1/get_migration_account', 'HostedMigration@getAccount');
Route::post('api/v1/get_migration_account', 'HostedMigrationController@getAccount')->middleware('guest');
Route::fallback('BaseController@notFound');