Skip to content
This repository was archived by the owner on May 3, 2022. It is now read-only.

Commit 14de01b

Browse files
committed
* fixed userinfo decrypting
1 parent 8800c85 commit 14de01b

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

src/Http/Controllers/TokenController.php

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -80,22 +80,13 @@ public function destroy($version, $deviceToken, $websitePushId, Request $request
8080
* Extract the user information from auth token.
8181
*
8282
* @param string $authenticationToken
83-
* @return array
83+
* @return mixed
8484
*/
85-
private function extractUserInfo(string $authenticationToken): array
85+
private function extractUserInfo(string $authenticationToken)
8686
{
8787
try {
88-
$userInfo = json_decode(
89-
decrypt($authenticationToken),
90-
true /* extract as assoc array */
91-
);
92-
93-
if ($userInfo === null) {
94-
throw new Exception('UserInfo is not in a valid JSON format.');
95-
}
96-
9788
// Return successful decoded user info.
98-
return $userInfo;
89+
return decrypt($authenticationToken);
9990
} catch (Exception $exc) {
10091
// Return the plain auth token in error case. This could be, because
10192
// the user decided to handle the token resolver by himself.

0 commit comments

Comments
 (0)