Improved Auth mechanism. Added redirecting feature.