Skip to content

Commit

Permalink
feature(gritty) drop support of authCheck and cloudcmd <= v9.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
coderaiser committed Jul 16, 2018
1 parent dc05eb7 commit 30e02d7
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 11 deletions.
6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,19 +61,13 @@ gritty('body', {
```js
const prefix = '/gritty'; // default

// legacy
const authCheck = (socket, success) => {
susccess();
};

const auth = (accept, reject) => (username, password) => {
accept();
};

gritty.listen(socket, {
prefix,
auth, // optional
authCheck, // optional
})
```

Expand Down
5 changes: 0 additions & 5 deletions server/gritty.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
const DIR_ROOT = __dirname + '/..';

const path = require('path');

const log = require('debug')('gritty');

const express = require('express');
Expand Down Expand Up @@ -79,16 +78,12 @@ module.exports.listen = (socket, options) => {

const prefix = options.prefix;
const auth = options.auth;
const authCheck = options.authCheck;

socket
.of(prefix || '/gritty')
.on('connection', (socket) => {
const connect = connectionWraped(options, socket);

if (authCheck)
return authCheck(socket, connect);

if (!auth)
return connection(options, socket);

Expand Down

0 comments on commit 30e02d7

Please sign in to comment.