Fix and close #3 - assign auth before generating the input