Added auth logic.