Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport release-3_38] OAuth2 configuration: trim leading/trailing blanks from most parameters set from UI to avoid weird issues #58395

Merged
merged 1 commit into from
Aug 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 16 additions & 17 deletions src/auth/oauth2/core/qgsauthoauth2config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,65 +112,64 @@ void QgsAuthOAuth2Config::setDescription( const QString &value )
void QgsAuthOAuth2Config::setRequestUrl( const QString &value )
{
const QString preval( mRequestUrl );
mRequestUrl = value;
if ( preval != value )
mRequestUrl = value.trimmed();
if ( preval != mRequestUrl )
emit requestUrlChanged( mRequestUrl );
}

void QgsAuthOAuth2Config::setTokenUrl( const QString &value )
{
const QString preval( mTokenUrl );
mTokenUrl = value;
if ( preval != value )
mTokenUrl = value.trimmed();
if ( preval != mTokenUrl )
emit tokenUrlChanged( mTokenUrl );
}

void QgsAuthOAuth2Config::setRefreshTokenUrl( const QString &value )
{
const QString preval( mRefreshTokenUrl );
mRefreshTokenUrl = value;
if ( preval != value )
mRefreshTokenUrl = value.trimmed();
if ( preval != mRefreshTokenUrl )
emit refreshTokenUrlChanged( mRefreshTokenUrl );
}

void QgsAuthOAuth2Config::setRedirectHost( const QString &host )
{
if ( mRedirectHost != host )
{
mRedirectHost = host;
const QString preval( mRedirectHost );
mRedirectHost = host.trimmed();
if ( preval != mRedirectHost )
emit redirectHostChanged( mRedirectHost );
}
}

void QgsAuthOAuth2Config::setRedirectUrl( const QString &value )
{
const QString preval( mRedirectURL );
mRedirectURL = value;
if ( preval != value )
mRedirectURL = value.trimmed();
if ( preval != mRedirectURL )
emit redirectUrlChanged( mRedirectURL );
}

void QgsAuthOAuth2Config::setRedirectPort( int value )
{
const int preval( mRedirectPort );
mRedirectPort = value;
if ( preval != value )
if ( preval != mRedirectPort )
emit redirectPortChanged( mRedirectPort );
}

void QgsAuthOAuth2Config::setClientId( const QString &value )
{
const QString preval( mClientId );
mClientId = value;
if ( preval != value )
mClientId = value.trimmed();
if ( preval != mClientId )
emit clientIdChanged( mClientId );
}

void QgsAuthOAuth2Config::setClientSecret( const QString &value )
{
const QString preval( mClientSecret );
mClientSecret = value;
if ( preval != value )
mClientSecret = value.trimmed();
if ( preval != mClientSecret )
emit clientSecretChanged( mClientSecret );
}

Expand Down
Loading