Init function should have option to redirect on authentication failure with status 302 Found. Redirect to login page is desirable in the following cases. - The token is expired. - Basic auth credentials are not passed. - Passwords did not match.