File tree 4 files changed +5
-5
lines changed
4 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -46,8 +46,7 @@ public function regenerateToken(string $refreshToken) : OauthToken{
46
46
->formParam ("refresh_token " ,$ refreshToken )
47
47
->formParam ("client_id " ,$ this ->details ->clientId )
48
48
->formParam ("client_secret " ,$ this ->details ->clientSecret )
49
- ->formParam ("redirect_uri " ,$ this ->details ->redirectUri )
50
- ->formParam ("grant_type " ,"authorization_code " )
49
+ ->formParam ("grant_type " ,"refresh_token " )
51
50
->getResponse ();
52
51
53
52
$ token = $ this ->helper ->readToken ($ response ->getBody ());
Original file line number Diff line number Diff line change 1
1
<?php
2
2
namespace encryptorcode \authentication \oauth ;
3
3
4
- class OauthException extends Exception{
4
+ class OauthException extends \ Exception{
5
5
6
6
}
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ public static function authenticate(AuthenticationHelper $helper) : void{
58
58
// fetching new access token if the token is expired
59
59
if (self ::isTimePassed ($ token ->getExpiryTime ())){
60
60
$ strategy = $ strategyLoader ->get ($ session ->getOauthStrategy ());
61
- $ token = $ strategy ->regenerateToken ($ token ->getRefreshToken ());
61
+ $ newToken = $ strategy ->regenerateToken ($ token ->getRefreshToken ());
62
62
$ newToken ->setRefreshToken ($ token ->getRefreshToken ());
63
63
$ sessionStorage ->updateSessionToken ($ sessionIdentifier ,$ newToken );
64
64
}
Original file line number Diff line number Diff line change 4
4
use encryptorcode \server \request \Request as Request ;
5
5
use encryptorcode \server \response \RedirectResponse as RedirectResponse ;
6
6
use encryptorcode \authentication \server \AuthRequest as AuthRequest ;
7
+ use encryptorcode \authentication \oauth \OauthException as OauthException ;
7
8
8
9
define ("AUTH_USER_KEY " ,"encryptorcode.authentication.user " );
9
10
define ("AUTH_SESSION_KEY " ,"encryptorcode.authentication.session " );
@@ -45,7 +46,7 @@ public function loginPage() : void{
45
46
$ strategyName = Request::param ("strategy " );
46
47
if (isset ($ strategyName )){
47
48
$ strategy = $ this ->strategyLoader ->get ($ strategyName );
48
- $ _SESSION [SESSION_REDIRECT_KEY ] = $ redirect ;
49
+ $ _SESSION [SESSION_REDIRECT_KEY ] = Request:: param ( " redirect " ) ;
49
50
$ this ->doRedirection ($ strategy ->getLoginUrl ($ strategyName ));
50
51
return ;
51
52
}
You can’t perform that action at this time.
0 commit comments