From 88b01b792af98be8b3aa9a787f025fc754992873 Mon Sep 17 00:00:00 2001 From: Alex Bilbie Date: Tue, 12 Apr 2016 20:23:05 +0100 Subject: [PATCH] Clarified example --- examples/public/refresh_token.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/examples/public/refresh_token.php b/examples/public/refresh_token.php index c8c0a396..643431c8 100644 --- a/examples/public/refresh_token.php +++ b/examples/public/refresh_token.php @@ -37,10 +37,13 @@ $app = new App([ $publicKeyPath ); - // Enable the refresh token grant on the server with a token TTL of 1 hour + // Enable the refresh token grant on the server + $grant = new RefreshTokenGrant($refreshTokenRepository); + $grant->setRefreshTokenTTL(new \DateInterval('P1M')); // The refresh token will expire in 1 month + $server->enableGrantType( - new RefreshTokenGrant($refreshTokenRepository), - new \DateInterval('PT1H') + $grant, + new \DateInterval('PT1H') // The new access token will expire after 1 hour ); return $server;