I have the following code:
$storedToken = getStoredToken();
/**
* Verify if the stored token has expired.
*/
if ($storedToken->hasExpired()) {
/**
* If the stored token has expired, then you request a new one.
*/
$newToken = $provider->getAccessToken('refresh_token', [
'refresh_token' => $storedToken->getRefreshToken()
In my db I have the following fields:
- token
- refreshtoken
- expires
I tried:
public function StoredToken(){
$user = Auth::user(); //data is on users table.
return $refreshtoken = $user->melirefreshtoken; //eg.
}
But with no success. I cannot find the way to create a function to create an object passing all the information.
Right now I received error:
Call to undefined function App\Http\Controllers\getStoredToken()
any help appreciated.
from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2Z8Cd3z
via IFTTT
Aucun commentaire:
Enregistrer un commentaire