Fix an infinite loop when having expired token
Occasionally, after an authorisation token expires, the app would keep
looping between the login page and the previous page spamming the user
with 'Unauthorised' notifications.
This commit also fixes the project being reset after an unauthorised API
call.