Added auth middleware.
Fixed specs, added post message redirect, autotest.