Skip to content

Commit

Permalink
qgso2.cpp: fix false-positive warning about potentially unused variable
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault authored and nyalldawson committed Jun 15, 2020
1 parent c77ba5e commit e2eabe4
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/auth/oauth2/qgso2.cpp
Expand Up @@ -81,32 +81,30 @@ void QgsO2::initOAuthConfig()
setApiKey( mOAuth2Config->apiKey() );
setExtraRequestParams( mOAuth2Config->queryPairs() );

O2::GrantFlow o2flow;
switch ( mOAuth2Config->grantFlow() )
{
case QgsAuthOAuth2Config::AuthCode:
o2flow = O2::GrantFlowAuthorizationCode;
setGrantFlow( O2::GrantFlowAuthorizationCode );
setRequestUrl( mOAuth2Config->requestUrl() );
setClientId( mOAuth2Config->clientId() );
setClientSecret( mOAuth2Config->clientSecret() );

break;
case QgsAuthOAuth2Config::Implicit:
o2flow = O2::GrantFlowImplicit;
setGrantFlow( O2::GrantFlowImplicit );
setRequestUrl( mOAuth2Config->requestUrl() );
setClientId( mOAuth2Config->clientId() );

break;
case QgsAuthOAuth2Config::ResourceOwner:
o2flow = O2::GrantFlowResourceOwnerPasswordCredentials;
setGrantFlow( O2::GrantFlowResourceOwnerPasswordCredentials );
setClientId( mOAuth2Config->clientId() );
setClientSecret( mOAuth2Config->clientSecret() );
setUsername( mOAuth2Config->username() );
setPassword( mOAuth2Config->password() );

break;
}
setGrantFlow( o2flow );

setSettingsStore( mOAuth2Config->persistToken() );

Expand Down

0 comments on commit e2eabe4

Please sign in to comment.