drafting example code for payload auth