fix(auth): return empty string from getAuthPassword for legacy null passwords (recaller hash_equals TypeError)
Build and Deploy / verify (push) Successful in 10s
Build and Deploy / deploy (push) Successful in 17s

This commit is contained in:
2026-10-12 23:07:10 +00:00
parent 3784b31ecf
commit 2d8752f863
+9
View File
@@ -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);