Updated Google Avatar, Admin Features, All Pages with small changes, Filters in Publications Page
This commit is contained in:
@@ -43,9 +43,21 @@ class GoogleController extends Controller
|
||||
[
|
||||
'name' => $googleUser->getName() ?: $email,
|
||||
'password' => bcrypt(Str::random(16)), // Generate a random password
|
||||
'profile_image' => $googleUser->getAvatar(),
|
||||
]
|
||||
);
|
||||
|
||||
// Update profile image if it changed or wasn't set (for existing users logging in)
|
||||
if (!$user->profile_image) {
|
||||
$user->update(['profile_image' => $googleUser->getAvatar()]);
|
||||
}
|
||||
|
||||
// Sync to FacultyProfile
|
||||
$profile = \App\Models\FacultyProfile::firstOrCreate(['user_id' => $user->id]);
|
||||
if (!$profile->profile_photo_path) {
|
||||
$profile->update(['profile_photo_path' => $googleUser->getAvatar()]);
|
||||
}
|
||||
|
||||
Auth::login($user);
|
||||
|
||||
return redirect()->route('dashboard');
|
||||
|
||||
Reference in New Issue
Block a user