Skip to content

Commit ab5a564

Browse files
Restored method for backward compatibility. Auto resolve none auth.
1 parent a5d7a8e commit ab5a564

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

src/Bolt.php

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ final class Bolt
5353
*/
5454
private $version;
5555

56+
/**
57+
* @var string
58+
*/
59+
private $scheme = 'basic';
60+
5661
/**
5762
* Print debug info
5863
* @var bool
@@ -102,6 +107,16 @@ public function setPackStreamVersion(int $version = 1): Bolt
102107
return $this;
103108
}
104109

110+
/**
111+
* @deprecated Use Auth helper
112+
* @param string $scheme
113+
* @return Bolt
114+
*/
115+
public function setScheme(string $scheme = 'basic'): Bolt
116+
{
117+
return $this;
118+
}
119+
105120
/**
106121
* Version is available after successful connection with init/hello message
107122
* @return float
@@ -198,7 +213,7 @@ public function init($userAgentOrExtra, string $user = '', string $password = ''
198213
{
199214
if (is_string($userAgentOrExtra)) {
200215
Auth::$userAgent = $userAgentOrExtra;
201-
$userAgentOrExtra = Auth::basic($user, $password);
216+
$userAgentOrExtra = empty($user) && empty($password) ? Auth::none() : Auth::basic($user, $password);
202217
if ($routing !== false)
203218
$userAgentOrExtra['routing'] = $routing;
204219
}

0 commit comments

Comments
 (0)