mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-26 08:13:16 +00:00
Update AuthLogin
This commit is contained in:
parent
b436ac2cbb
commit
c6b1164620
2 changed files with 7 additions and 4 deletions
|
@ -31,7 +31,7 @@ class RegisterController extends Controller
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $redirectTo = '/home';
|
protected $redirectTo = '/';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new controller instance.
|
* Create a new controller instance.
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
namespace App\Listeners;
|
namespace App\Listeners;
|
||||||
|
|
||||||
|
use DB;
|
||||||
use App\User;
|
use App\User;
|
||||||
use App\UserSetting;
|
use App\UserSetting;
|
||||||
use Illuminate\Queue\InteractsWithQueue;
|
use Illuminate\Queue\InteractsWithQueue;
|
||||||
|
@ -29,9 +30,11 @@ class AuthLogin
|
||||||
{
|
{
|
||||||
$user = $event->user;
|
$user = $event->user;
|
||||||
if (empty($user->settings)) {
|
if (empty($user->settings)) {
|
||||||
$settings = new UserSetting();
|
DB::transaction(function() use($user) {
|
||||||
$settings->user_id = $user->id;
|
UserSetting::firstOrCreate([
|
||||||
$settings->save();
|
'user_id' => $user->id
|
||||||
|
]);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue