mirror of https://github.com/tiangolo/fastapi.git
some fixes
This commit is contained in:
parent
f0dc846ea2
commit
c8c04115a1
|
|
@ -507,7 +507,6 @@ class OAuthFlowImplicit(OAuthFlow):
|
|||
|
||||
class OAuthFlowPassword(OAuthFlow):
|
||||
tokenUrl: str
|
||||
refreshUrl: Optional[str]
|
||||
|
||||
|
||||
class OAuthFlowClientCredentials(OAuthFlow):
|
||||
|
|
|
|||
|
|
@ -408,14 +408,6 @@ class OAuth2PasswordBearer(OAuth2):
|
|||
"""
|
||||
),
|
||||
],
|
||||
refreshUrl: Annotated[
|
||||
Optional[str],
|
||||
Doc(
|
||||
"""
|
||||
The URL to refresh the token and obtain a new one.
|
||||
"""
|
||||
),
|
||||
],
|
||||
scheme_name: Annotated[
|
||||
Optional[str],
|
||||
Doc(
|
||||
|
|
@ -465,12 +457,22 @@ class OAuth2PasswordBearer(OAuth2):
|
|||
"""
|
||||
),
|
||||
] = True,
|
||||
refreshUrl: Annotated[
|
||||
Optional[str],
|
||||
Doc(
|
||||
"""
|
||||
The URL to refresh the token and obtain a new one.
|
||||
"""
|
||||
),
|
||||
] = None,
|
||||
):
|
||||
if not scopes:
|
||||
scopes = {}
|
||||
flows = OAuthFlowsModel(
|
||||
password=cast(
|
||||
Any, {"tokenUrl": tokenUrl, "refreshUrl": refreshUrl, "scopes": scopes}
|
||||
Any,
|
||||
{"tokenUrl": tokenUrl, "refreshUrl": refreshUrl, "scopes": scopes} if refreshUrl else
|
||||
{"tokenUrl": tokenUrl, "scopes": scopes}
|
||||
)
|
||||
)
|
||||
super().__init__(
|
||||
|
|
|
|||
Loading…
Reference in New Issue