implement find_or_create_user
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Dabestaniha\AuthenticateBridge\Requests;
|
||||
namespace Dabestaniha\AuthenticateBridge\App\Http\Requests;
|
||||
|
||||
use Dabestaniha\AuthenticateBridge\Support\Collection;
|
||||
|
||||
@@ -54,6 +54,7 @@ abstract class BaseFormRequest
|
||||
{
|
||||
return match ($rule) {
|
||||
'required' => !empty($value),
|
||||
'nullable' => true,
|
||||
default => false,
|
||||
};
|
||||
}
|
||||
+5
-2
@@ -1,19 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace Dabestaniha\AuthenticateBridge\Requests;
|
||||
namespace Dabestaniha\AuthenticateBridge\App\Http\Requests;
|
||||
|
||||
class DabestanihaAuthenticateRequest extends BaseFormRequest
|
||||
{
|
||||
|
||||
public function shouldContinue(): bool
|
||||
{
|
||||
return $this->getRoutePath() === '/dabestaniha/login';
|
||||
$path = $this->getRoutePath();
|
||||
return trim($path, '/') === 'dabestaniha/login';
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'token' => ['required'],
|
||||
'name' => ['nullable'],
|
||||
'email' => ['nullable'],
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -7,3 +7,12 @@ if (!function_exists('view')) {
|
||||
return file_get_contents("{$basedir}resources/views/$view.php");
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('dd')) {
|
||||
function dd(): never
|
||||
{
|
||||
echo '<pre>';
|
||||
array_map(function($arg) {var_dump($arg);}, func_get_args());
|
||||
die;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
|
||||
<!-- views/invalid-token.php -->
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>خطا سامانه</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>اوه...</h1>
|
||||
<p>مشکلی پیش آمده، لطفا تا دقایق دیگر دوباره امتحان کنید.</p>
|
||||
<a href="<?= home_url() ?>">بازگشت به صفحه اصلی</a>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user