diff --git a/.gitignore b/.gitignore index 2dd2aae..c69473b 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ composer.phar composer.lock vendor coverage/* +.idea/* diff --git a/src/Support/Response.php b/src/Support/Response.php index e669a3b..26f16ab 100644 --- a/src/Support/Response.php +++ b/src/Support/Response.php @@ -90,6 +90,10 @@ public function makeRequestOneTimePasswordResponse() */ private function getView() { + if ($this->config('type_view') === 'inertia') { + return \Inertia\Inertia::render($this->config('view'))->toResponse($this->getRequest())->throwResponse(); + } + return view($this->config('view')); } diff --git a/src/config/config.php b/src/config/config.php index a04fefd..485ce71 100644 --- a/src/config/config.php +++ b/src/config/config.php @@ -54,6 +54,11 @@ */ 'otp_secret_column' => 'google2fa_secret', + /* + * Type of user view, blade or inertia + */ + 'type_view' => 'blade', + /* * One Time Password View. */