Skip to content

Commit 8c5b7c2

Browse files
fix: username/password not set for MailAccount
refs conjoon/conjoon#23
1 parent 050d88c commit 8c5b7c2

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/Illuminate/Auth/LocalMailAccount/LocalAccountProvider.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,18 @@ public function __construct(Request $request)
6161
public function getUser(string $username, string $password): ?ImapUser
6262
{
6363
$config = $this->decodePayload($this->payload);
64-
$mailAccount = $this->createMailAccount($config);
64+
$mailAccount = $this->createMailAccount($username, $password, $config);
6565

6666
return new ImapUser($username, $password, $mailAccount);
6767
}
6868

69-
private function createMailAccount(array $config): MailAccount
69+
private function createMailAccount(string $username, string $password, array $config): MailAccount
7070
{
7171
$merged = array_merge($config, [
7272
"id" => $this->mailAccountId,
7373
"name" => $this->mailAccountId,
74+
"inbox_user" => $username,
75+
"inbox_password" => $password
7476
]);
7577
return new MailAccount($merged);
7678
}

tests/Illuminate/Auth/LocalMailAccount/LocalAccountProviderTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ public function testGetUser()
8888
"replyTo" => ["address" => "", "name" => "name"],
8989
"inbox_address" => "address",
9090
"inbox_port" => 8080,
91-
"inbox_user" => "user",
92-
"inbox_password" => "pw",
91+
"inbox_user" => "inboxUsername",
92+
"inbox_password" => "inboxPassword",
9393
"outbox_address" => "address",
9494
"outbox_port" => 8080,
9595
"outbox_user" => "user",
@@ -104,7 +104,7 @@ public function testGetUser()
104104

105105
$provider = new LocalAccountProvider($request);
106106

107-
$user = $provider->getUser("username", "password");
107+
$user = $provider->getUser("inboxUsername", "inboxPassword");
108108
$this->assertInstanceOf(ImapUser::class, $user);
109109

110110
$this->assertNull($user->getMailAccount("routeIdNotAvailable"));

0 commit comments

Comments
 (0)