v2.2.2: Refactors context handling for authentication
Ensures context is consistently handled as a Resource, improving type safety and preventing potential errors related to mixed type handling. Removes unnecessary nullable types and enforces Resource type where appropriate.