Good day,

I am trying to construct a login system that redirects the login to different 
controllers depending on which membership they belong to. Below is the code 
snippet. I need some tips to access the variable containing the user id. I 
believe I might need to look at a session variable.  If there are any other 

@auth.requires_login()
def index():
    """
    Redirects user to the appropriate controller based on the group user 
belongs 
to
    """
    membership = db.auth_membership(user_id=SOME_SESSION_USER_VARIABLE)
    if membership.group_id == 2:
        redirect(URL(f=workspace))
    elif membership.group_id == 3:
        redirect(URL(f=dashboard))



      

Reply via email to