Skip to content

Commit 87bb296

Browse files
committed
fixes
1 parent c768118 commit 87bb296

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Document/AccessToken.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
/**
1111
* AccessToken
1212
*
13-
* @ODM\Document(collection="access_tokens")
13+
* @ODM\Document(collection="accessTokens")
1414
*
1515
* @UniqueEntity(fields={"modelId", "value"})
1616
* @ODM\HasLifecycleCallbacks()

Service/Helper/AccessTokenHelper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ public function generateToken($modelId, $withSave = true)
6464
{
6565
$token = $this->om->createNewTokenInstance();
6666

67-
$tokenValue = base64_encode(md5(time() . $modelId));
68-
$tokenValue = str_replace('=', '', $tokenValue);
67+
$tokenValue = md5(time() . $modelId) . ':' . json_encode(['id' => $modelId]);
68+
$tokenValue = str_replace('=', '', base64_encode($tokenValue));
6969

7070
$token
7171
->setModelId($modelId)

0 commit comments

Comments
 (0)