Skip to content

Commit

Permalink
[oauth2] Use token url if refresh token url is not specified
Browse files Browse the repository at this point in the history
The refresh token url is marked as optional -- so we fallback
on the token url if user has not specified a specific refresh URL
  • Loading branch information
nyalldawson committed Oct 25, 2018
1 parent 6fc36dc commit e24e5c7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/auth/oauth2/qgso2.cpp
Expand Up @@ -69,7 +69,8 @@ void QgsO2::initOAuthConfig()
mIsLocalHost = isLocalHost( QUrl( localpolicy.arg( mOAuth2Config->redirectPort() ) ) );

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

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

0 comments on commit e24e5c7

Please sign in to comment.