fix(auth): return empty string from getAuthPassword for legacy null passwords (recaller hash_equals TypeError)
This commit is contained in:
@@ -80,6 +80,15 @@ class User extends Authenticatable implements FilamentUser
|
||||
return $this->hasMany(Post::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 兼容老用户 password 为 null:remember-me 校验时 hash_equals 不接受 null,
|
||||
* 返回空串使其校验失败并忽略 recaller,而不是抛 TypeError 造成全站 500。
|
||||
*/
|
||||
public function getAuthPassword()
|
||||
{
|
||||
return $this->password ?? '';
|
||||
}
|
||||
|
||||
public function comments(): HasMany
|
||||
{
|
||||
return $this->hasMany(Comment::class);
|
||||
|
||||
Reference in New Issue
Block a user