towhid
1 month ago
353
11
Laravel

Laravel Socialite GitHub redirect page 404 page not found

Posted 1 month ago by towhid

Following this documentation

composer require laravel/socialite

this is my service.php page code

    'github' => [
        'client_id'     => env('GITHUB_CLIENT_ID'),
        'client_secret' => env('GITHUB_CLIENT_SECRET'),
        'redirect'      => env('GITHUB_CALLBACK'),
    ],

this is my .env github code

GITHUB_CLIENT_ID=bece543261*******
GITHUB_CLIENT_SECRET=319070ae1ebb2877c6********
GITHUB_CALLBACK=http://laravel-feature.test/login/github/callback

i am using laragon thats why my server link is

http://laravel-feature.test

this is my route code

Route::get('login/github', 'Auth\[email protected]');
Route::get('login/github/callback', 'Auth\[email protected]');

this is my logincontroller code

    public function redirectToProvider()
    {
        return Socialite::driver('github')->redirect();
    }

    public function handleProviderCallback()
    {
        $user = Socialite::driver('github')->user();

        // $user->token;
    }

this is my login blade code

 <a href="login/github" class="btn btn-primary">
                                    {{ __('Login Github') }}
                                </a>

but when i am click login github button its redirect to this link and show 404 page not found

Error Page: https://github.com/login/oauth/authorize?scope=user%3Aemail&response_type=code&state=KE2aGOZe9GnnHqqCBnyywLhatqkTzLeGP2FQlXTz

so what's the problem ? if any one face this kind of please help me thank you

Please sign in or create an account to participate in this conversation.