The emergency legislation, approved by a majority of 177 out of 293 lawmakers, allows authorities to detain asylum seekers in camps for up to 18 months.