Simplified login-routing code using idiomatic if-let