-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- 토큰 claim에 primary profile uid 추가 - 토큰 로직 수정 - 프로필 select sql 추가 - primary 프로필 없을 시 첫번째 프로필을 primary로 취급
- Loading branch information
Showing
12 changed files
with
141 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?php | ||
|
||
namespace App\Application\Common\service; | ||
|
||
interface TokenService | ||
{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
namespace App\Application\Common\service; | ||
|
||
use App\Application\Common\MemberPasswordEncrypt; | ||
use App\Application\Middleware\JwtHandler; | ||
use Psr\Log\LoggerInterface; | ||
|
||
class TokenServiceImplement implements TokenService | ||
{ | ||
private ?MemberPasswordEncrypt $passwordEncrypt; | ||
private ?JwtHandler $jwtHandler; | ||
private ?LoggerInterface $logger; | ||
|
||
public function __construct( | ||
MemberPasswordEncrypt $passwordEncrypt, | ||
JwtHandler $jwtHandler, | ||
LoggerInterface $logger | ||
) { | ||
$this->passwordEncrypt = $passwordEncrypt; | ||
$this->logger = $logger; | ||
$this->jwtHandler = $jwtHandler; | ||
} | ||
|
||
public function getUserIdFromToken(string $token) { | ||
$decodedToken = $this->passwordEncrypt->decrypt($token); | ||
$decryptedJwt = $this->jwtHandler->decryptToken($decodedToken); | ||
$claims = $this->jwtHandler->decodeJwt($decryptedJwt); | ||
|
||
return $this->jwtHandler->getUserIdFromClaims($claims); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters