@@ 313-318 (lines=6) @@ | ||
310 | if (!empty($token)) { |
|
311 | // token does not exist! |
|
312 | $tokenExists = null; // perform a real check here against your db! |
|
313 | if (null == $tokenExists) { |
|
314 | $this->failure('authentication_error', "The token does not exist!", 401); |
|
315 | $this->setOAuthError('invalid_grant'); |
|
316 | ||
317 | return false; |
|
318 | } |
|
319 | // check token is not out-of-date |
|
320 | $expires = 0; // get the expiry from your db! |
|
321 | if (time() > $expires) { |
|
@@ 321-326 (lines=6) @@ | ||
318 | } |
|
319 | // check token is not out-of-date |
|
320 | $expires = 0; // get the expiry from your db! |
|
321 | if (time() > $expires) { |
|
322 | $this->failure('authentication_error', "The token expired!", 401); |
|
323 | $this->setOAuthError('invalid_grant'); |
|
324 | ||
325 | return false; |
|
326 | } |
|
327 | // if token found load the user for the token from your db! |
|
328 | } |
|
329 |