Skip to content

Commit

Permalink
Cause easyrtc.setUsername to complain if a user calls it after authen…
Browse files Browse the repository at this point in the history
…tication.
  • Loading branch information
EricDavies committed Jan 13, 2015
1 parent 5484871 commit 702ec54
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions api/easyrtc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2335,8 +2335,11 @@ var Easyrtc = function() {
*
*/
this.setUsername = function(username) {

if (self.isNameValid(username)) {
if( self.myEasyrtcid ) {
easyrtc.showError(easyrtc.errCodes.DEVELOPER_ERR, "easyrtc.setUsername called after authentication");
return false;
}
else if (self.isNameValid(username)) {
self.username = username;
return true;
}
Expand Down

0 comments on commit 702ec54

Please sign in to comment.