Initial V2 commit 4
This commit is contained in:
@@ -9,10 +9,16 @@ use Firebase\JWT\Key;
|
||||
use Firebase\JWT\ExpiredException;
|
||||
|
||||
/**
|
||||
* JWT Authentication Middleware
|
||||
* وسيط التحقق من الهوية (JWT Authentication Middleware)
|
||||
*
|
||||
* Validates JWT tokens from the Authorization header.
|
||||
* Works in conjunction with HMAC middleware for double-layer security.
|
||||
* الغرض من الملف:
|
||||
* التحقق من "رمز الوصول" (Access Token) الذي يحمله المستخدم بعد تسجيل الدخول للتأكد من هويته.
|
||||
*
|
||||
* كيفية العمل:
|
||||
* 1. يستخرج الرمز من رأس الطلب (Authorization Header).
|
||||
* 2. يقوم بفك تشفير الرمز (Decode) باستخدام مفتاح سري (JWT Secret).
|
||||
* 3. يستخرج بيانات المستخدم (مثل المعرف والنوع) ويضيفها للطلب ليسهل الوصول إليها في المتحكمات.
|
||||
* 4. يمنع الطلب إذا كان الرمز منتهي الصلاحية أو غير صحيح.
|
||||
*/
|
||||
class JwtAuthMiddleware
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user