mirror of
https://github.com/NyaaStudios/nyaabooru.git
synced 2025-12-10 05:42:58 +00:00
add name change support & adjust profile list view
This commit is contained in:
parent
c7c621b086
commit
33d4ff5fb4
6 changed files with 74 additions and 26 deletions
|
|
@ -18,12 +18,16 @@ class AuthController extends Controller
|
|||
$user = Socialite::driver('authentik')->user();
|
||||
|
||||
$authUser = User::updateOrCreate(
|
||||
[ 'email' => $user->getEmail() ],
|
||||
[ 'name' => $user->getName() ]
|
||||
[ 'email' => $user->getEmail() ]
|
||||
);
|
||||
|
||||
if ($authUser)
|
||||
{
|
||||
if ($authUser->name == '')
|
||||
{
|
||||
$authUser->name = $user->getName();
|
||||
$authUser->save();
|
||||
}
|
||||
Auth::login($authUser);
|
||||
return redirect('/');
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue