Make login persist token + better error handling