Example #1
0
def register(account):
    if libsqrl.has_flag(account.tif, libsqrl.TIF.AccountCreationEnabled):
        payload = create_request_body(user, url, cmd='create')
        response = post_request(payload.serialize())
        if libsqrl.has_flag(response.tif, libsqrl.TIF.CommandFailed):
            print 'Error creating account.'
        else:
            #print response
            print 'Success'
    else:
        print 'Account registration is not enabled.'
Example #2
0
def register(account):
    if libsqrl.has_flag(account.tif, libsqrl.TIF.AccountCreationEnabled):
        payload = create_request_body(user, url, cmd='create')
        response = post_request(payload.serialize())
        if libsqrl.has_flag(response.tif, libsqrl.TIF.CommandFailed):
            print 'Error creating account.'
        else:
            #print response
            print 'Success'
    else:
        print 'Account registration is not enabled.'
Example #3
0
def login(account):
    if libsqrl.has_flag(account.tif, libsqrl.TIF.IdMatch):
        payload = create_request_body(user, url, cmd='login')
        response = post_request(payload.serialize())
    else:
        print 'No account registered.'
Example #4
0
def login(account):
    if libsqrl.has_flag(account.tif, libsqrl.TIF.IdMatch):
        payload = create_request_body(user, url, cmd='login')
        response = post_request(payload.serialize())
    else:
        print 'No account registered.'