kopia lustrzana https://github.com/pixelfed/pixelfed
Update AuthLogin listener
rodzic
362fd1b029
commit
8e8e6cafec
|
@ -42,6 +42,13 @@ class AuthLogin
|
||||||
protected function userProfile($user)
|
protected function userProfile($user)
|
||||||
{
|
{
|
||||||
if (empty($user->profile)) {
|
if (empty($user->profile)) {
|
||||||
|
if($user->created_at->lt(now()->subDays(1))) {
|
||||||
|
$p = Profile::withTrashed()->whereUserId($user->id)->first();
|
||||||
|
if($p) {
|
||||||
|
$p->restore();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
DB::transaction(function() use($user) {
|
DB::transaction(function() use($user) {
|
||||||
$profile = Profile::firstOrCreate(['user_id' => $user->id]);
|
$profile = Profile::firstOrCreate(['user_id' => $user->id]);
|
||||||
if($profile->wasRecentlyCreated == true) {
|
if($profile->wasRecentlyCreated == true) {
|
||||||
|
|
Ładowanie…
Reference in New Issue