Fix pin-server redirect errors

#2270

When there is a token error there is no longer an infinite redirect loop.