Skip to content

Commit c98cf4b

Browse files
author
gcohen
committed
typo in false, adding auth detection
1 parent a74c5ab commit c98cf4b

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

web/examples/channelGroups/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<body>
1212
<script src=http://code.jquery.com/jquery-1.11.0.min.js></script>
1313

14-
<script src=../../pubnub.min.js></script>
14+
<script src=../../pubnub.js></script>
1515
<div class="output" id="errorOutputDiv">
1616
<textarea id="output" rows=20 cols="85"></textarea>
1717
</div>
@@ -40,7 +40,7 @@ <h3>Config (clear)</h3>
4040
<br><br>
4141
Using Credentials (AuthToken) to issue the request
4242
<br>
43-
<input type="checkbox" id="authEnable" name="authEnable" checked>
43+
<input type="checkbox" id="authEnable" name="authEnable" >
4444
AuthKey
4545
<input type="text" id="auth" name="auth" value="public">
4646

web/examples/channelGroups/main.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ $("#channel, #channelEnable").bind("change", function () {
3737
function authInit() {
3838
authEnable = $("#authEnable").prop('checked');
3939
auth = authEnable && $("#auth").val().length > 0 ? $("#auth").val() : false;
40+
if (auth && typeof pubnub != "undefined") {
41+
pubnub.auth(auth);
42+
}
4043
}
4144

4245
authInit();
@@ -363,5 +366,5 @@ $("#setCloak").click(function () {
363366
pnCloak(true);
364367
});
365368
$("#unsetCloak").click(function () {
366-
pnCloak(fals);
369+
pnCloak(false);
367370
});

0 commit comments

Comments
 (0)