mirror of
https://github.com/fastapi-users/fastapi-users.git
synced 2025-11-02 12:21:53 +08:00
* Added a failing test for the multi-oauth-router issue * Fixed the #823 regression. Using a regex for the backend name validation instead of an enum. * Fixed formatting errors * Moved the `AuthenticationBackendName` enum to `Authenticator` This prevents an issue with OpenAPI schema generation caused by two endpoints accepting a parameter with a duplicate name.
This commit is contained in:
@ -1,4 +1,3 @@
|
||||
import enum
|
||||
from typing import Dict, List
|
||||
|
||||
import jwt
|
||||
@ -44,11 +43,6 @@ def get_oauth_router(
|
||||
route_name=callback_route_name,
|
||||
)
|
||||
|
||||
AuthenticationBackendName: enum.EnumMeta = enum.Enum(
|
||||
"AuthenticationBackendName",
|
||||
{backend.name: backend.name for backend in authenticator.backends},
|
||||
)
|
||||
|
||||
@router.get(
|
||||
"/authorize",
|
||||
name="oauth:authorize",
|
||||
@ -56,7 +50,7 @@ def get_oauth_router(
|
||||
)
|
||||
async def authorize(
|
||||
request: Request,
|
||||
authentication_backend: AuthenticationBackendName,
|
||||
authentication_backend: authenticator.backends_enum, # type: ignore
|
||||
scopes: List[str] = Query(None),
|
||||
):
|
||||
if redirect_url is not None:
|
||||
|
||||
Reference in New Issue
Block a user