xero-api Initialise Problems - xero-api

I have attempted to set up xero-node passing in the consumer key and consumer secret along with the app name as the user Agent. However when I do a test call e.g. xeroClient.core.users.getUsers() the code just seems to freeze not giving any errors however I cannot move any further.

Are you able to post a gist of the code you are using?
What App type are you using (Private, Public or Partner)?
Have you seen the code samples on the main GitHub page? There is also a sample app here: https://github.com/XeroAPI/xero-node-sample-app

Related

Offline notification with nuxt/pwa

I am currently looking through the options of creating an offline indication for the nuxt/pwa project. Since this moment, app is running perfectly offline, but what I want to do is to push a small notification when there is no connection saying something simple such as "you are currently offline".
I can see that there are multiple ways of doing this such as writing the event listener directly in the default layout, but my question is which one is the most suitable and reliable for the nuxt setup.
I think you don't need to write your own event listener, as this seems to be taken care of by the nuxt already. The network status seems to be accessible via $nuxt helper's isOnline and isOffline properties. Check out this example:
https://nuxtjs.org/api/$nuxt/
I have not worked with this yet, but I think it might be what you are looking for.
Note: Make sure to copy the whole link, as stackoverflow cuts it off at /$nuxt.

Can someone clarify IOS Safari Service Worker Support

Looking at the MDN documentation IOS/Safari fully supports ServiceWorkerGlobalScope.onfetch but when you look at the FetchEvent specification it says it is not supported at all by Safari.
In particular, I would like to store some state for each client and was hoping to use the fetchEvent.clientId property of the event to index it. Of course I presume I also have access to the fetchEvent.request object otherwise I can't see how a service worker can do anything useful and I could simulate clientID from a passed in parameter in the url. But the docs don't really tell me what IOS/Safari supports and doesn't so I don't know which way to go.
Can someone please tell me precisely what does IOS/Safari pass when it calls the defined onfetch function.
I found the answer to my question by using https://jakearchibald.github.io/isserviceworkerready/demos/fetchevent/
connecting my iPad to my Macbook and debugging my iPad. I was eventually able to open the web inspector for the Service worker for that page, and the console.log showed the event passed in.
FetchEvent.clientID is present but a zero length string. As it happens I did the same thing on my (linux) Desktop using Chrome and its also a zero length string, BUT it has another parameter resultingClientId with what looks like a UUID in it. That parameter is not there in Safari.
The FetchEvent.request is there, and in particular the URL. So I can generate my own client id in the client (I am using Date.now().toString() as that is good enough for my purposes) for use in the service worker. In fact my site without a service worker was using the in the URLs I need to intercept already, so I am happy that I have a solution.

Laravel 4: when using Config::set to change auth.model then Auth::user() not work

My laravel project has two login system.
1) Using user_name and Password
2) Using secret code
my 1st login system work properly. because auth.model has 'User' model.
so I use 'Config::set' in 'tempSing' method to obtain 2nd login as bellow.
Config::set('auth.model', 'TempUser')
Config::set('auth.table', 'temp_user')
After that code I use bellow code
$user= TempUser::where('secret_code','=',Input::get('code'))->first();
Auth::login($user,true);
if(Auth::check())
return Redirect::route('getTemp');
then that code work properly and redirect to the 'getTemp' and after routing it make 'temp.php'. but their include
if(Auth::check())
so my problem is above logic not become true. that problem is occurred when using 'Config::set' but I Configured 'auth.model' and 'auth.table' manualy in 'auth.php' not happen any error. Please help me.
I would assume Laravel initializes the Auth service once when the application is started, so later edits to configuration don't affect it anymore. A solution would be to initialize an instance yourself, and use that.

Where does console output go in an IIS hosted app?

Say I have a WCF app hosted in IIS. And in that app I run this line of code:
Console.WriteLine("Testing, testing 1 2 3");
Where will that be written to? Or is it ignored and just lost?
Is there someway to capture it when needed?
Nowhere. More specifically:
NullStream, which is defined as "A Stream with no backing store.".
All the methods do nothing or return nothing. It is an internal class
to Stream. The following code is taken from Microsoft's source code.
Basically, when one of the Console write methods is call the first
time, a call is made to the Windows API function GetStdHandle for
"standard output". If no handle is returned a NullStream is created
and used.
quoted from here: https://stackoverflow.com/a/2075892/12744
actually, the same answer goes to on to address the second part of your question too:
To actually redirect Console output, regardless of the project type, use
Console.SetOut(New System.IO.StreamWriter("C:\ConsoleOutput.txt")),

IAT/EAT hooking "gethostbyname"

I wrote this code to hook API functions by changing the address in the IAT and EAT: http://pastebin.com/7d9N1J2c
This works just fine when I want to hook "recv" or "connect". However for some unknown reason when trying to hook "gethostbyname", my hook function is never called.
I tried to find "gethostbyname" in a debugger by taking the base address of the wsock32.dll module + 0x375e, which is what the ordinal 52 of my wsock32.dll is showing as offset. But that just makes me end up in some random asm code, not at the beginning of a function.
The same method however works fine for trying to find the "recv" entry point.
Does anyone see what I might be doing wrong?
I recommend this tool:
http://www.moduleanalyzer.com/
They do exactly the same and show the url that was connected with that API.
The problem is that there are more than one API to translate an url to an address. The application you are hooking may be using another version of the API that you're not intercepting.
Run some disassembler like IDA and attach to your process after you hook this functions, ida get apply changes on attaching and play process and check what is wrong.
In other way you have many libraries to do hooks with trampolines like Microsoft Detours, NCodeHook etc.