Skip to content

Commit e24e5c7

Browse files
committed
[oauth2] Use token url if refresh token url is not specified
The refresh token url is marked as optional -- so we fallback on the token url if user has not specified a specific refresh URL
1 parent 6fc36dc commit e24e5c7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/auth/oauth2/qgso2.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ void QgsO2::initOAuthConfig()
6969
mIsLocalHost = isLocalHost( QUrl( localpolicy.arg( mOAuth2Config->redirectPort() ) ) );
7070

7171
setTokenUrl( mOAuth2Config->tokenUrl() );
72-
setRefreshTokenUrl( mOAuth2Config->refreshTokenUrl() );
72+
// refresh token url is marked as optional -- we use the token url if user has not specified a specific refresh URL
73+
setRefreshTokenUrl( !mOAuth2Config->refreshTokenUrl().isEmpty() ? mOAuth2Config->refreshTokenUrl() : mOAuth2Config->tokenUrl() );
7374

7475
setScope( mOAuth2Config->scope() );
7576
// TODO: add support to O2 (or this class?) for state query param

0 commit comments

Comments
 (0)