mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 10:45:47 +00:00
refactor(cloudcmd) authCheck: early return
This commit is contained in:
parent
7888a1e725
commit
7a9f50c0da
1 changed files with 5 additions and 6 deletions
|
|
@ -103,12 +103,11 @@ function authCheck(socket, success) {
|
|||
const isName = name === config('username');
|
||||
const isPass = pass === config('password');
|
||||
|
||||
if (isName && isPass) {
|
||||
success();
|
||||
socket.emit('accept');
|
||||
} else {
|
||||
socket.emit('reject');
|
||||
}
|
||||
if (!isName || !isPass)
|
||||
return socket.emit('reject');
|
||||
|
||||
success();
|
||||
socket.emit('accept');
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue