scottybo / socialite-wordpress-wp-oauth-server

A Socialite Provider which allows you to connect your self hosted Wordpress system via the WP OAuth Server Plugin
3 stars 2 forks source link

Driver [WordPressSelfHosted] not supported. #1

Closed 101t closed 5 years ago

101t commented 5 years ago

Hi, Could you help me, please? I installed the package using composer I got this error.

Driver [WordPressSelfHosted] not supported.

I think this miss configuration in app/Providers/AppServiceProvider.php and call it from the boot() method.

<?php

namespace App\Providers;

use Illuminate\Support\ServiceProvider;

class AppServiceProvider extends ServiceProvider
{
    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
        //
        $this->bootWordPressSelfHostedSocialite();
    }

    /**
     * Register any application services.
     *
     * @return void
     */
    public function register()
    {
        //
    }
    private function bootWordPressSelfHostedSocialite()
    {
        $socialite = $this->app->make('Laravel\Socialite\Contracts\Factory');
        $socialite->extend(
            'WordPressSelfHosted',
            function ($app) use ($socialite) {
                $config = $app['config']['services.wordpress_self_hosted'];
                return $socialite->buildProvider(\SocialiteProviders\WordPressSelfHosted\Provider::class, $config);
            }
        );
    }
}

Thank you.

101t commented 5 years ago

This is required to works fine