Skip to content

Commit 2246872

Browse files
committed
WIP
1 parent ab6d99d commit 2246872

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

src/Connectors/DocuWareConnector.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,9 @@ protected function defaultAuth(): TokenAuthenticator
5353

5454
/**
5555
* @throws InvalidArgumentException
56+
* @throws \Exception
5657
*/
57-
protected function getOrCreateNewOAuthToken()
58+
protected function getOrCreateNewOAuthToken(): string
5859
{
5960
$cache = Cache::store($this->configuration->cacheDriver);
6061

src/DTO/Config/ConfigWithCredentials.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace CodebarAg\DocuWare\DTO\Config;
44

5+
use Illuminate\Support\Facades\Crypt;
56
use Illuminate\Support\Facades\Hash;
67

78
final class ConfigWithCredentials
@@ -36,7 +37,6 @@ public function __construct(
3637
?int $requestTimeoutInSeconds = null,
3738
?string $clientId = null,
3839
?string $scope = null,
39-
?string $identifier = null,
4040
) {
4141
$this->username = $username;
4242
$this->password = $password;
@@ -55,6 +55,6 @@ public function __construct(
5555

5656
$this->scope = filled($scope) ? $scope : config('laravel-docuware.configurations.scope');
5757

58-
$this->identifier = filled($identifier) ? $identifier : Hash::make($this->url.'.'.$this->username.'.'.$this->clientId);
58+
$this->identifier = Hash::make($this->url.'.'.$this->username.'.'.Crypt::encrypt($this->password));
5959
}
6060
}

src/DTO/Config/ConfigWithCredentialsTrustedUser.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace CodebarAg\DocuWare\DTO\Config;
44

5+
use Illuminate\Support\Facades\Crypt;
56
use Illuminate\Support\Facades\Hash;
67

78
final class ConfigWithCredentialsTrustedUser
@@ -39,7 +40,6 @@ public function __construct(
3940
?int $requestTimeoutInSeconds = null,
4041
?string $clientId = null,
4142
?string $scope = null,
42-
?string $identifier = null,
4343
) {
4444
$this->username = $username;
4545
$this->password = $password;
@@ -59,6 +59,6 @@ public function __construct(
5959

6060
$this->scope = filled($scope) ? $scope : config('laravel-docuware.configurations.scope');
6161

62-
$this->identifier = filled($identifier) ? $identifier : Hash::make($this->url.'.'.$this->username.'.'.$this->clientId);
62+
$this->identifier = Hash::make($this->url.'.'.$this->username.'.'.Crypt::encrypt($this->password));
6363
}
6464
}

0 commit comments

Comments
 (0)