ATMachine said:
One could say the same thing about Leia taking off her disguise in the middle of Jabba's throne room. Frankly I doubt Luke's "plan" (such as it was) accounted for such rash stupidity. (Some things run in the family, I guess.)
1. She thought everyone was asleep.
2. Han needed to know who was rescuing him.