Skip to content

Commit

Permalink
Merge pull request #250 from Kolyunya/send-extra-data-while-atuhentic…
Browse files Browse the repository at this point in the history
…ation

Send extra data while authentication
  • Loading branch information
Tobias Oberstein committed Jan 11, 2017
2 parents 352c593 + 46ba06b commit 3976650
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/connection.js
Expand Up @@ -308,7 +308,7 @@ Connection.prototype.open = function () {
self._connect_successes += 1; self._connect_successes += 1;


// start WAMP session // start WAMP session
self._session.join(self._options.realm, self._options.authmethods, self._options.authid); self._session.join(self._options.realm, self._options.authmethods, self._options.authid, self._options.authextra);
}; };


self._session.onjoin = function (details) { self._session.onjoin = function (details) {
Expand Down
5 changes: 4 additions & 1 deletion lib/session.js
Expand Up @@ -1131,7 +1131,7 @@ Session.prototype.log = function () {
}; };




Session.prototype.join = function (realm, authmethods, authid) { Session.prototype.join = function (realm, authmethods, authid, authextra) {


util.assert(typeof realm === 'string', "Session.join: <realm> must be a string"); util.assert(typeof realm === 'string', "Session.join: <realm> must be a string");
util.assert(!authmethods || Array.isArray(authmethods), "Session.join: <authmethods> must be an array []"); util.assert(!authmethods || Array.isArray(authmethods), "Session.join: <authmethods> must be an array []");
Expand All @@ -1155,6 +1155,9 @@ Session.prototype.join = function (realm, authmethods, authid) {
if (authid) { if (authid) {
details.authid = authid; details.authid = authid;
} }
if (authextra) {
details.authextra = authextra;
}


var msg = [MSG_TYPE.HELLO, realm, details]; var msg = [MSG_TYPE.HELLO, realm, details];
self._send_wamp(msg); self._send_wamp(msg);
Expand Down

0 comments on commit 3976650

Please sign in to comment.