<?php namespace Illuminate\Auth; class Recaller { /** * The "recaller" / "remember me" cookie string. * * @var string */ protected $recaller; /** * Create a new recaller instance. * * @param string $recaller * @return void */ public function __construct($recaller) { $this->recaller = @unserialize($recaller, ['allowed_classes' => false]) ?: $recaller; } /** * Get the user ID from the recaller. * * @return string */ public function id() { return explode('|', $this->recaller, 3)[0]; } /** * Get the "remember token" token from the recaller. * * @return string */ public function token() { return explode('|', $this->recaller, 3)[1]; } /** * Get the password from the recaller. * * @return string */ public function hash() { return explode('|', $this->recaller, 4)[2]; } /** * Determine if the recaller is valid. * * @return bool */ public function valid() { return $this->properString() && $this->hasAllSegments(); } /** * Determine if the recaller is an invalid string. * * @return bool */ protected function properString() { return is_string($this->recaller) && str_contains($this->recaller, '|'); } /** * Determine if the recaller has all segments. * * @return bool */ protected function hasAllSegments() { $segments = explode('|', $this->recaller); return count($segments) >= 3 && trim($segments[0]) !== '' && trim($segments[1]) !== ''; } /** * Get the recaller's segments. * * @return array */ public function segments() { return explode('|', $this->recaller); } }
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
.github | Folder | 0755 |
|
|
Access | Folder | 0755 |
|
|
Console | Folder | 0755 |
|
|
Events | Folder | 0755 |
|
|
Listeners | Folder | 0755 |
|
|
Middleware | Folder | 0755 |
|
|
Notifications | Folder | 0755 |
|
|
Passwords | Folder | 0755 |
|
|
.gitattributes | File | 54 B | 0644 |
|
AuthManager.php | File | 8.59 KB | 0644 |
|
AuthServiceProvider.php | File | 3.15 KB | 0644 |
|
Authenticatable.php | File | 1.83 KB | 0644 |
|
AuthenticationException.php | File | 1.13 KB | 0644 |
|
CreatesUserProviders.php | File | 2.5 KB | 0644 |
|
DatabaseUserProvider.php | File | 4.76 KB | 0644 |
|
EloquentUserProvider.php | File | 6.43 KB | 0644 |
|
GenericUser.php | File | 2.62 KB | 0644 |
|
GuardHelpers.php | File | 2.67 KB | 0644 |
|
LICENSE.md | File | 1.07 KB | 0644 |
|
MustVerifyEmail.php | File | 1 KB | 0644 |
|
Recaller.php | File | 1.93 KB | 0644 |
|
RequestGuard.php | File | 2.16 KB | 0644 |
|
SessionGuard.php | File | 27.42 KB | 0644 |
|
TokenGuard.php | File | 3.51 KB | 0644 |
|
composer.json | File | 1.28 KB | 0644 |
|