Repository: litestar-org/litestar

Issue:
Bug: Importing from litestar.security.jwt cause a circular import
### Description

Hello,

when upgrading from 2.3.2 to 2.4.0 version of litestar.

I got a message saying depreciation warning about the import of `litestar.contrib.jwt` that will be removed in 3.0 and that is deprecated in 2.4.0


### URL to code causing the issue

_No response_

### MCVE

```python
from litestar.security.jwt import OAuth2Login
```


### Steps to reproduce

```bash
1. Just import `litestar.security.jwt`
2. See error
```


### Screenshots

_No response_

### Logs

```bash
ImportError: cannot import name 'BaseJWTAuth' from partially initialized module 'litestar.security.jwt.auth' (most likely due to a circular import)
```


### Litestar Version

2.4.0

### Platform

- [ ] Linux
- [X] Mac
- [ ] Windows
- [ ] Other (Please specify in the description above)

<!-- POLAR PLEDGE BADGE START -->
---
> [!NOTE]  
> While we are open for sponsoring on [GitHub Sponsors](https://github.com/sponsors/litestar-org/) and 
> [OpenCollective](https://opencollective.com/litestar), we also utilize [Polar.sh](https://polar.sh/) to engage in pledge-based sponsorship.
>
> Check out all issues funded or available for funding [on our Polar.sh Litestar dashboard](https://polar.sh/litestar-org)
> * If you would like to see an issue prioritized, make a pledge towards it!
> * We receive the pledge once the issue is completed & verified
> * This, along with engagement in the community, helps us know which features are a priority to our users.

<a href="https://polar.sh/litestar-org/litestar/issues/2782">
<picture>
  <source media="(prefers-color-scheme: dark)" srcset="https://polar.sh/api/github/litestar-org/litestar/issues/2782/pledge.svg?darkmode=1">
  <img alt="Fund with Polar" src="https://polar.sh/api/github/litestar-org/litestar/issues/2782/pledge.svg">
</picture>
</a>
<!-- POLAR PLEDGE BADGE END -->



Discussion:

Resolving patch:
diff --git a/litestar/security/jwt/auth.py b/litestar/security/jwt/auth.py
--- a/litestar/security/jwt/auth.py
+++ b/litestar/security/jwt/auth.py
@@ -4,13 +4,13 @@
 from datetime import datetime, timedelta, timezone
 from typing import TYPE_CHECKING, Any, Callable, Generic, Iterable, Literal, Sequence, TypeVar, cast
 
-from litestar.contrib.jwt.jwt_token import Token
-from litestar.contrib.jwt.middleware import JWTAuthenticationMiddleware, JWTCookieAuthenticationMiddleware
 from litestar.datastructures import Cookie
 from litestar.enums import MediaType
 from litestar.middleware import DefineMiddleware
 from litestar.openapi.spec import Components, OAuthFlow, OAuthFlows, SecurityRequirement, SecurityScheme
 from litestar.security.base import AbstractSecurityConfig
+from litestar.security.jwt.middleware import JWTAuthenticationMiddleware, JWTCookieAuthenticationMiddleware
+from litestar.security.jwt.token import Token
 from litestar.status_codes import HTTP_201_CREATED
 from litestar.types import ControllerRouterHandler, Empty, Guard, Method, Scopes, SyncOrAsyncUnion, TypeEncodersMap
 
diff --git a/litestar/security/jwt/middleware.py b/litestar/security/jwt/middleware.py
--- a/litestar/security/jwt/middleware.py
+++ b/litestar/security/jwt/middleware.py
@@ -2,12 +2,12 @@
 
 from typing import TYPE_CHECKING, Awaitable, Callable, Sequence
 
-from litestar.contrib.jwt.jwt_token import Token
 from litestar.exceptions import NotAuthorizedException
 from litestar.middleware.authentication import (
     AbstractAuthenticationMiddleware,
     AuthenticationResult,
 )
+from litestar.security.jwt.token import Token
 
 __all__ = ("JWTAuthenticationMiddleware", "JWTCookieAuthenticationMiddleware")
 


Test patch: