basic implementation of auth

Just added a basic implementation of auth here so I could test my own projects being able to handle login issues if a token is removed.
The _defer() needs to remain so that flush() and autoFlush() can be used to control when the callback is actually invoked.