diff options
| -rw-r--r-- | xmpp/routing.go | 2 | ||||
| -rw-r--r-- | xmpp/sasl.go | 9 | 
2 files changed, 11 insertions, 0 deletions
diff --git a/xmpp/routing.go b/xmpp/routing.go index 48c9763..9199874 100644 --- a/xmpp/routing.go +++ b/xmpp/routing.go @@ -65,6 +65,8 @@ func (r *tokenRouter) route(t xml.Token, c *Conn) error {  func routeElement(b []xml.Token, c *Conn) error {  	tab := elementRoutingTable{  		{xml.Name{"http://etherx.jabber.org/streams", "features"}, streamFeatures}, +		{xml.Name{"urn:ietf:params:xml:ns:xmpp-sasl", "success"}, onSaslSuccess}, +		{xml.Name{"urn:ietf:params:xml:ns:xmpp-sasl", "failure"}, onSaslFailure},  	}  	switch unwrapped := b[0].(type) { diff --git a/xmpp/sasl.go b/xmpp/sasl.go index cbc1f11..91cbf6b 100644 --- a/xmpp/sasl.go +++ b/xmpp/sasl.go @@ -48,3 +48,12 @@ func sendSaslAuth(b []xml.Token, c *Conn) error {  	return errors.New("No compatible SASL mechanism given")  } + +func onSaslSuccess(b []xml.Token, c *Conn) error { +	sendStreamStart(&c.enc, c.jid) +	return nil +} + +func onSaslFailure(b []xml.Token, c *Conn) error { +	return errors.New("Authentication failed") +}  | 
