feat: add Discord authentication framework
This commit is contained in:
parent
f44ff75b77
commit
10da9f6797
23
app/Http/Controllers/Auth/DiscordController.php
Normal file
23
app/Http/Controllers/Auth/DiscordController.php
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Auth;
|
||||||
|
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Laravel\Socialite\Facades\Socialite;
|
||||||
|
|
||||||
|
class DiscordController extends Controller
|
||||||
|
{
|
||||||
|
|
||||||
|
public function redirect() {
|
||||||
|
|
||||||
|
return Socialite::driver('discord')->redirect();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function callback() {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -49,6 +49,10 @@ class EventServiceProvider extends ServiceProvider
|
|||||||
Login::class => [
|
Login::class => [
|
||||||
LogAuthenticationSuccess::class,
|
LogAuthenticationSuccess::class,
|
||||||
],
|
],
|
||||||
|
\SocialiteProviders\Manager\SocialiteWasCalled::class => [
|
||||||
|
// ... other providers
|
||||||
|
\SocialiteProviders\Discord\DiscordExtendSocialite::class.'@handle',
|
||||||
|
],
|
||||||
'App\Events\ApplicationApprovedEvent' => [
|
'App\Events\ApplicationApprovedEvent' => [
|
||||||
'App\Listeners\PromoteUser',
|
'App\Listeners\PromoteUser',
|
||||||
],
|
],
|
||||||
|
@ -71,6 +71,8 @@ Route::group(['prefix' => LaravelLocalization::setLocale(), 'middleware' => ['lo
|
|||||||
'verify' => true
|
'verify' => true
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
//Route::get('auth/redirect/discord',)
|
||||||
|
|
||||||
Route::post('/twofa/authenticate', [TwofaController::class, 'verify2FA'])
|
Route::post('/twofa/authenticate', [TwofaController::class, 'verify2FA'])
|
||||||
->name('verify2FA');
|
->name('verify2FA');
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user