This was broken with commit c1fb1a7def, which splits the result in order to print the error reason and in case of error was not returning the error and the message to prosody internals.
This is a hook to override the username that will be used when authenticating token users (which are using anonymous login with auto-generated username).