The authenticate() method should return a document reference and to a string to improve the design of this module. This is obviously a breakage in the API that is better to apply early.