Fixed phonegap auth handling