Skip to content

Add twitter oauth #41

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/Http/Controllers/User/SettingController.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function update(UpdateProfileRequest $request)
]);

if ($request->avatar) {
$user->addFromMediaLibraryRequest($request->avatar)
$user->addMediaFromRequest('avatar')
->toMediaCollection('avatar');
$user->avatar_type = 'storage';
$user->save();
Expand All @@ -65,7 +65,7 @@ public function password()
'sessions' => Cache::remember('login-sessions', 60 * 60 * 24 * 5, function () {
return collect(
DB::table('sessions')
->where('user_id', auth()->user()->getKey())
->where('user_id', auth()->id())
->orderBy('last_activity', 'desc')
->limit(3)
->get()
Expand Down
7 changes: 1 addition & 6 deletions app/Http/Requests/UpdateProfileRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,9 @@

use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Auth;
use Spatie\MediaLibraryPro\Rules\Concerns\ValidatesMedia;

class UpdateProfileRequest extends FormRequest
{
use ValidatesMedia;

/**
* Determine if the user is authorized to make this request.
*
Expand All @@ -35,9 +32,7 @@ public function rules(): array
'github_profile' => 'max:255|nullable|unique:users,github_profile,' . Auth::id(),
'bio' => 'nullable|max:160',
'website' => 'nullable|url',
'avatar' => $this->validateSingleMedia()
->extension(['png', 'jpg', 'jpeg'])
->maxItemSizeInKb(1024),
'avatar' => 'nullable|image|max:2048',
];
}
}
3 changes: 3 additions & 0 deletions app/Providers/EventServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ class EventServiceProvider extends ServiceProvider
CommentWasAdded::class => [
SendNewCommentNotification::class,
],
\SocialiteProviders\Manager\SocialiteWasCalled::class => [
\SocialiteProviders\Twitter\TwitterExtendSocialite::class . '@handle',
],
];

/**
Expand Down
8 changes: 0 additions & 8 deletions auth.json

This file was deleted.

15 changes: 5 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,20 @@
"laravel/slack-notification-channel": "^2.3",
"laravel/socialite": "^5.2",
"laravel/tinker": "^2.5",
"livewire/livewire": "^2.8",
"livewire/livewire": "^2.10",
"qcod/laravel-gamify": "^1.0",
"ramsey/uuid": "^4.2",
"sentry/sentry-laravel": "^2.10",
"socialiteproviders/twitter": "^4.1",
"spatie/laravel-feed": "^4.0",
"spatie/laravel-medialibrary-pro": "^1.0.0",
"spatie/laravel-medialibrary": "^9.0.0",
"spatie/laravel-permission": "^5.1",
"spatie/laravel-sitemap": "^6.0",
"stevebauman/location": "^6.2",
"torchlight/torchlight-commonmark": "^0.5.2",
"wire-elements/modal": "^1.0",
"wire-elements/spotlight": "^1.0",
"wireui/wireui": "^0.14.0",
"wireui/wireui": "^1.1.3",
"yarri/link-finder": "^2.7"
},
"require-dev": {
Expand Down Expand Up @@ -91,7 +92,6 @@
],
"setup": [
"php -r \"file_exists('.env') || copy('.env.example', '.env');\"",
"php -r \"file_exists('auth.json') || copy('auth.json.example', 'auth.json');\"",
"php artisan key:generate",
"php artisan migrate --seed",
"php artisan lcm:admin"
Expand All @@ -112,10 +112,5 @@
},
"minimum-stability": "dev",
"prefer-stable": true,
"repositories": [
{
"type": "composer",
"url": "https://satis.spatie.be"
}
]
"repositories": []
}
Loading