install firebase jwt and use token for authenticate
This commit is contained in:
@@ -8,15 +8,13 @@ class DabestanihaAuthenticateRequest extends BaseFormRequest
|
||||
public function shouldContinue(): bool
|
||||
{
|
||||
$path = $this->getRoutePath();
|
||||
return trim($path, '/') === 'dabestaniha/login';
|
||||
return trim($path, '/') === get_configured_option('login-route');
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'token' => ['required'],
|
||||
'name' => ['nullable'],
|
||||
'email' => ['nullable'],
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -32,5 +32,7 @@ return [
|
||||
'jwt-secret' => 'کلید JWT',
|
||||
'user-identifier' => 'فیلد شناسایی کاربر',
|
||||
'login-route' => 'آدرس لاگین دبستانی ها',
|
||||
|
||||
'new-user' => 'کاربر جدید',
|
||||
],
|
||||
];
|
||||
+1
-1
@@ -46,6 +46,6 @@ if (!function_exists('config')) {
|
||||
if (!function_exists('get_configured_option')) {
|
||||
function get_configured_option(string $key, ?string $default = null): null|string|array
|
||||
{
|
||||
return get_option(config($key), $default);
|
||||
return get_option(config("da.options.$key"), $default);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user