I want to create myself a user then log him.
This for an open source project : https://github.com/bussiere/jackpoint 
I've been on it for 3 days now.

I want to create a user then loggin him and auth him.
If you find it just give me your paypal in private buy you a drink.

Here is my code :
def test():

      password="toto"
        my_crypt = CRYPT(key=auth.settings.hmac_key)
        crypt_pass = my_crypt(password)[0]    
        user = db.auth_user.insert(
           Surnom="Surnom",
           email="email5@toto",
           username="titi",
           password=crypt_pass,
                           )
        db.commit()
        
        user = auth.login_bare("titi",password)
        session.auth = 
Storage(user=user,expiration=auth.settings.expiration,hmac_key=str(uuid4()))
        redirect(URL('inscriptioninvit'))

@auth.requires_login()
def inscriptioninvit():
     return "hello"

Reply via email to