-
Notifications
You must be signed in to change notification settings - Fork 939
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[5.x] Add
refreshToken
method (#675)
* Add refreshToken method * Fix code style * Fix naming * Fix Twitter provider * Remove unnecessary parameter from Twitter provider * formatting * fix comma --------- Co-authored-by: Taylor Otwell <[email protected]>
- Loading branch information
1 parent
7cec8ba
commit dc14fca
Showing
4 changed files
with
125 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?php | ||
|
||
namespace Laravel\Socialite\Two; | ||
|
||
class Token | ||
{ | ||
/** | ||
* The user's access token. | ||
* | ||
* @var string | ||
*/ | ||
public $token; | ||
|
||
/** | ||
* The refresh token that can be exchanged for a new access token. | ||
* | ||
* @var string | ||
*/ | ||
public $refreshToken; | ||
|
||
/** | ||
* The number of seconds the access token is valid for. | ||
* | ||
* @var int | ||
*/ | ||
public $expiresIn; | ||
|
||
/** | ||
* The scopes the user authorized. The approved scopes may be a subset of the requested scopes. | ||
* | ||
* @var array | ||
*/ | ||
public $approvedScopes; | ||
|
||
/** | ||
* Create a new token instance. | ||
* | ||
* @param string $token | ||
* @param string $refreshToken | ||
* @param int $expiresIn | ||
* @param array $approvedScopes | ||
*/ | ||
public function __construct(string $token, string $refreshToken, int $expiresIn, array $approvedScopes) | ||
{ | ||
$this->token = $token; | ||
$this->refreshToken = $refreshToken; | ||
$this->expiresIn = $expiresIn; | ||
$this->approvedScopes = $approvedScopes; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters