aboutsummaryrefslogtreecommitdiff
path: root/app/User.php
diff options
context:
space:
mode:
authorCamil Staps2016-10-18 11:45:29 +0200
committerCamil Staps2016-10-18 11:45:29 +0200
commitbd271840496248553e634b2e325e34076666375c (patch)
treee8fdbe56d6a1b365449e2cfb9b40bd75ff029fd9 /app/User.php
parentSuggetsions ordering (diff)
Fix authentication
Diffstat (limited to 'app/User.php')
-rw-r--r--app/User.php50
1 files changed, 4 insertions, 46 deletions
diff --git a/app/User.php b/app/User.php
index 6520bb6..ca14b40 100644
--- a/app/User.php
+++ b/app/User.php
@@ -18,21 +18,16 @@
*/
namespace HebrewParseTrainer;
-use Illuminate\Contracts\Auth\Authenticatable;
-use Illuminate\Contracts\Auth\CanResetPassword;
-use Illuminate\Auth\Passwords\CanResetPassword as CanResetPasswordTrait;
-use Illuminate\Notifications\Notifiable;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Hash;
+use Illuminate\Foundation\Auth\User as FoundationUser;
-class User extends Model implements Authenticatable, CanResetPassword {
-
- use CanResetPasswordTrait;
- use Notifiable;
+class User extends FoundationUser {
protected $table = 'users';
public $timestamps = false;
- protected $fillable = ['email', 'name', 'isadmin'];
+ protected $fillable = ['email', 'name', 'password', 'isadmin'];
+ protected $hidden = ['password', 'remember_token'];
const VOTE_WEIGHT_BASE = 5;
@@ -58,41 +53,4 @@ class User extends Model implements Authenticatable, CanResetPassword {
return floor(log($this->points, self::VOTE_WEIGHT_BASE));
}
- public function verifyPassword($pass) {
- if (!Hash::check($pass, $this->password))
- return false;
-
- if (Hash::needsRehash($this->password)) {
- $this->password = $pass;
- $this->save();
- }
-
- return true;
- }
-
- public function getAuthIdentifierName() {
- return 'id';
- }
-
- public function getAuthIdentifier() {
- return $this->id;
- }
-
- public function getAuthPassword() {
- return $this->password;
- }
-
- public function getRememberToken() {
- return $this->remember_token;
- }
-
- public function setRememberToken($token) {
- $this->remember_token = $token;
- $this->save();
- }
-
- public function getRememberTokenName() {
- return 'remember_token';
- }
-
}