Fixed broken authentication workflow