mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-23 00:05:29 +00:00
Update AuthLogin listener
This commit is contained in:
parent
362fd1b029
commit
8e8e6cafec
1 changed files with 7 additions and 0 deletions
|
@ -42,6 +42,13 @@ class AuthLogin
|
|||
protected function userProfile($user)
|
||||
{
|
||||
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) {
|
||||
$profile = Profile::firstOrCreate(['user_id' => $user->id]);
|
||||
if($profile->wasRecentlyCreated == true) {
|
||||
|
|
Loading…
Reference in a new issue