Skip to main content

LoginRequiredMixin

Verify that the current user is authenticated.

Methods


dispatch()

@classmethod
def dispatch(
request: [HttpRequest](../../../http/request/httprequest.md?sid=django_http_request_httprequest),
*args: tuple,
**kwargs: dict
) - > [HttpResponse](../../../http/response/httpresponse.md?sid=django_http_response_httpresponse)

Verify that the current user is authenticated.

Parameters

NameTypeDescription
request[HttpRequest](../../../http/request/httprequest.md?sid=django_http_request_httprequest)The incoming HTTP request object containing the user authentication state to be verified.
*argstuplePositional arguments passed to the view handler.
**kwargsdictKeyword arguments passed to the view handler, typically captured from the URL pattern.

Returns

TypeDescription
[HttpResponse](../../../http/response/httpresponse.md?sid=django_http_response_httpresponse)The standard HTTP response from the parent class if authenticated, or the result of handle_no_permission() if the user is anonymous.