Fixed stupid bug. App now authorises correctly.