Add pre auth checks to authentication.

Added pre auth checks based on previously added post auth and updated broken php doc.