middleware/login.py
def login_required(req, resp, resource, params):
    """Checks whether user is logged in

    Args:
        req (object): Request
        resp (object): Response
        resource (object): Ressource accessed
        params (object): Params
    """
    session = req.context.session
    if "user" in session:
        return
    else:
        raise falcon.HTTPUnauthorized("User is not logged in")
Checks whether user is logged in

    Args:
        req (object): Request
        resp (object): Response
        resource (object): Ressource accessed
        params (object): Params
    
Checks whether user is logged in
Checks whether user is logged in
def login_required(req, resp, resource, params):
    session = req.context.session
    if "user" in session:
        return
    else:
        raise falcon.HTTPUnauthorized("User is not logged in")
def login_required ( req , resp , resource , params ) : session = req . context . session if "user" in session : return else : raise falcon . HTTPUnauthorized ( "User is not logged in" )
Checks whether user is logged in
Checks whether user is logged in
"""Checks whether user is logged in

    Args:
        req (object): Request
        resp (object): Response
        resource (object): Ressource accessed
        params (object): Params
    """
req
None
resp
None
resource
None
params
None