Closed ghost closed 8 years ago
@DeeJaVu You need to pass it an instance of AccessToken instead of a string.
<?php
use Wubs\Trakt\Auth\Token;
$token = Token::create(
$accessToken,
$type,
$expires
$refresh,
$scope
);
That's how the AccessToken is created. All these values are given back from Trakt when you get the access token for the first time. You should store them somewhere and every time you need an access token crate it from these values.
Does this help? I'll document the access token a bit more in the documentation. I hope to have it finished by the end of this week.
I just updated the documentation.
Thank you for letting me know :+1:
i have one problem in my config/trakt.php i have this
return [
"client_id" => '59a5d****',
"client_secret" => '62295b1****',
"redirect_uri" => 'http://localhost.dev',
];
the client_id and client_secret are working but the the redirect_uri not as you can see in the image below
so when i go try to authorize like this
// http://localhost.dev/authorize
Route::get('authorize', function (Trakt $trakt) {
//this wil redirect you to the trakt website and, after authorization by the user, trakt will redirect back.
$trakt->auth->authorize();
});
the trakt website says "The redirect uri included is not valid."
@DeeJaVu Did you register the redirect url with your trakt.tv API App?
FIXED just looked in
vendor\wubs\trakt\src\Wubs\Trakt\Providers\Laravel\TraktApiServiceProvider.php
public function register()
{
$this->app->singleton(
TraktProvider::class,
function ($app) {
return new TraktProvider(
config("trakt.client_id"),
config('trakt.client_secret'),
config('trakt.trakt_redirect_uri')
);
}
);
$this->app->bind('trakt', Trakt::class);
}
so i changed config/trakt.php
redirect_uri to trakt_redirect_uri and now its working
its working perfect now :+1:
pls can you help me with this
i get this error
i have readed the readme but i dont understand how i can do this in a controller