strophe/strophejs — pull request #1 by dimalev (2013-05-20 14:08:31+00:00)
Title: Pluggable auth

in our usecase we needed new auth mechanism, to do this - we had to copy/paste _conntect_cb function and rewrite 'if' part of the code.

to avoid this, i suggest making a list of mechanisms with priorities and check against each in loop. each mechanism is described in general with test function to check if it suitable to run (inspired by anonymous VS plain auth - you cannot use plain auth if you do not have jid, while it is kindoff prefurable over anonymous) and actual run callback.

this pull request is a draft, i am not much happy with the 'look' of the code, while functionally it's good. maybe someone have suggestions?