Improve the code that decides whether a local login token is being used
correctly.