install firebase jwt and use token for authenticate

This commit is contained in:
2025-07-16 19:22:19 +03:30
parent cb29022311
commit 89a7eed847
23 changed files with 2737 additions and 15 deletions
@@ -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'],
];
}
}
+2
View File
@@ -32,5 +32,7 @@ return [
'jwt-secret' => 'کلید JWT',
'user-identifier' => 'فیلد شناسایی کاربر',
'login-route' => 'آدرس لاگین دبستانی ها',
'new-user' => 'کاربر جدید',
],
];
+1 -1
View File
@@ -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);
}
}