Skip to content

Commit

Permalink
Allow user credentials to be defined in config options
Browse files Browse the repository at this point in the history
  • Loading branch information
bensmiley committed Apr 11, 2019
1 parent d335c5a commit fb3dad3
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@

fileMessagesEnabled: true,

hideMainBox: false,
hideMainBox: false



}

Expand Down
12 changes: 12 additions & 0 deletions app/js/network/auto-login.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,18 @@ angular.module('myApp.services').factory('AutoLogin', ["$window", "Credential",
}
}
}

// If the parameters aren't set, check the config options
if (this.username === "" && !Utils.unORNull(ChatSDKOptions.username)) {
this.username = ChatSDKOptions.username;
}
if (this.password === "" && !Utils.unORNull(ChatSDKOptions.password)) {
this.password = ChatSDKOptions.password;
}
if (this.roomID === "" && !Utils.unORNull(ChatSDKOptions.roomID)) {
this.roomID = ChatSDKOptions.roomID;
}

this.updated = true;
},

Expand Down
1 change: 1 addition & 0 deletions app/js/services.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
angular.module('myApp.services', ['firebase']).value('version', '0.1');

0 comments on commit fb3dad3

Please sign in to comment.