Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10294,6 +10294,12 @@ paths:
schema:
$ref: '#/components/schemas/HTTPExceptionResponse'
description: Temporary Redirect
'400':
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPExceptionResponse'
description: Bad Request
'422':
description: Validation Error
content:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,16 @@

@auth_router.get(
"/login",
responses=create_openapi_http_exception_doc([status.HTTP_307_TEMPORARY_REDIRECT]),
responses=create_openapi_http_exception_doc(
[status.HTTP_307_TEMPORARY_REDIRECT, status.HTTP_400_BAD_REQUEST]
),
)
def login(request: Request, auth_manager: AuthManagerDep, next: None | str = None) -> RedirectResponse:
"""Redirect to the login URL depending on the AuthManager configured."""
login_url = auth_manager.get_url_login()

if next and not is_safe_url(next, request=request):
raise HTTPException(status_code=400, detail="Invalid or unsafe next URL")
raise HTTPException(status.HTTP_400_BAD_REQUEST, detail="Invalid or unsafe next URL")

if next:
login_url += f"?{urlencode({'next': next})}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4086,6 +4086,7 @@ export class LoginService {
},
errors: {
307: 'Temporary Redirect',
400: 'Bad Request',
422: 'Validation Error'
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7264,6 +7264,10 @@ export type $OpenApiTs = {
* Temporary Redirect
*/
307: HTTPExceptionResponse;
/**
* Bad Request
*/
400: HTTPExceptionResponse;
/**
* Validation Error
*/
Expand Down
Loading