Ejemplo n.º 1
0
    def register(cls, data):

        hashed_pw = security.hash_password({"password" : data['password']})
        data["password"] = hashed_pw
        result = user_svc.create_user(data)
        s_info = user_svc.get_by_email(data['email'])
        tok = security.generate_token(s_info)
        return result, tok
Ejemplo n.º 2
0
def t2():

    user = {
        "last_name": "Gamgee",
        "first_name": "Sam",
        "email": "*****@*****.**",
        "password": "******"
    }

    r = UserService.create_user(user)
    print("Result = ", r)