Skip to content

Commit f5e0ddd

Browse files
committed
Correct authentication
Can't always be true
1 parent 9a56e5c commit f5e0ddd

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/nessus/nessus-xmlrpc.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,12 @@ def authenticate(username, password)
2828
:json => 1
2929
}
3030
res = http_post(:uri=>"/session", :data=>payload)
31-
@token = "token=#{res['token']}"
32-
true
31+
if res['token']
32+
@token = "token=#{res['token']}"
33+
return true
34+
else
35+
false
36+
end
3337
end
3438

3539
def x_cookie

0 commit comments

Comments
 (0)