Skip to content
This repository has been archived by the owner on Jan 15, 2021. It is now read-only.

Commit

Permalink
More minor changes to entity calls
Browse files Browse the repository at this point in the history
  • Loading branch information
burzum committed Apr 27, 2017
1 parent 8810ff1 commit 765b5a8
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/Model/Behavior/UserBehavior.php
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ public function verifyToken($token, $options = []) {
return $result;
}

return $result->token_is_expired;
return $result->get('token_is_expired');
}

/**
Expand All @@ -420,14 +420,19 @@ public function verifyToken($token, $options = []) {
* @return mixed
*/
public function afterTokenVerification(Entity $user, $options = []) {
if ($user->token_is_expired === true) {
if ($user->get('token_is_expired') === true) {
return false;
}
if ($options['tokenField'] === $this->_field('emailToken')) {
$user->{$this->_field('emailVerified')} = 1;
$user->{$this->_field('emailToken')} = null;
$user->{$this->_field('emailTokenExpires')} = null;
$user->set([
$user->{$this->_field('emailVerified')} => true,
$user->{$this->_field('emailToken')} => null,
$user->{$this->_field('emailTokenExpires')} => null
], [
'guard' => false
]);
}

return $this->_table->save($user, ['validate' => false]);
}

Expand Down

0 comments on commit 765b5a8

Please sign in to comment.