Skip to content

Commit

Permalink
Registration and cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
viktorprogger committed Aug 14, 2020
1 parent 5843d6e commit 1221027
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 19 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
"yiisoft/var-dumper": "^3.0@dev",
"yiisoft/view": "^3.0@dev",
"yiisoft/widget": "^3.0@dev",
"yiisoft/yii-bootstrap4": "^3.0@dev",
"yiisoft/yii-console": "^3.0@dev",
"yiisoft/yii-cycle": "^3.0@dev",
"yiisoft/yii-web": "^3.0@dev",
Expand All @@ -56,6 +55,7 @@
"yiisoft/data-response": "^3.0@dev"
},
"require-dev": {
"roave/security-advisories": "dev-master",
"fzaninotto/faker": "^1.9"
},
"autoload": {
Expand Down
Empty file modified runtime/.gitignore
100644 → 100755
Empty file.
18 changes: 0 additions & 18 deletions src/Entity/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,13 @@
use DateTimeImmutable;
use Doctrine\Common\Collections\ArrayCollection;
use Yiisoft\Security\PasswordHasher;
use Yiisoft\Security\Random;
use Yiisoft\Auth\IdentityInterface;

/**
* @Entity(repository="App\Repository\UserRepository", mapper="Yiisoft\Yii\Cycle\Mapper\TimestampedMapper")
* @Table(
* indexes={
* @Index(columns={"login"}, unique=true),
* @Index(columns={"token"}, unique=true)
* }
* )
*/
Expand All @@ -33,11 +31,6 @@ class User implements IdentityInterface
*/
private ?int $id = null;

/**
* @Column(type="string(128)")
*/
private string $token;

/**
* @Column(type="string(48)")
*/
Expand Down Expand Up @@ -76,7 +69,6 @@ public function __construct(string $login, string $password)
$this->created_at = new DateTimeImmutable();
$this->updated_at = new DateTimeImmutable();
$this->setPassword($password);
$this->resetToken();
$this->posts = new ArrayCollection();
$this->comments = new ArrayCollection();
}
Expand All @@ -86,16 +78,6 @@ public function getId(): ?string
return $this->id === null ? null : (string)$this->id;
}

public function getToken(): string
{
return $this->token;
}

public function resetToken(): void
{
$this->token = Random::string(128);
}

public function getLogin(): string
{
return $this->login;
Expand Down

0 comments on commit 1221027

Please sign in to comment.