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.'
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.'