1
0
mirror of https://github.com/strawberrymusicplayer/strawberry synced 2025-01-15 01:56:54 +01:00

GeniusLyricsProvider: Convert client ID and secret from base64

Fixes #1554
This commit is contained in:
Jonas Kvinge 2024-09-18 22:51:28 +02:00
parent f11de5bfc2
commit 0e7ab1cab8

View File

@ -134,7 +134,7 @@ void GeniusLyricsProvider::Authenticate() {
}
QUrlQuery url_query;
url_query.addQueryItem(QStringLiteral("client_id"), QString::fromLatin1(QUrl::toPercentEncoding(QLatin1String(kClientIDB64))));
url_query.addQueryItem(QStringLiteral("client_id"), QString::fromLatin1(QUrl::toPercentEncoding(QString::fromLatin1(QByteArray::fromBase64(kClientIDB64)))));
url_query.addQueryItem(QStringLiteral("redirect_uri"), QString::fromLatin1(QUrl::toPercentEncoding(redirect_url.toString())));
url_query.addQueryItem(QStringLiteral("scope"), QStringLiteral("me"));
url_query.addQueryItem(QStringLiteral("state"), QString::fromLatin1(QUrl::toPercentEncoding(code_challenge_)));
@ -198,8 +198,8 @@ void GeniusLyricsProvider::RequestAccessToken(const QUrl &url, const QUrl &redir
QUrlQuery new_url_query;
new_url_query.addQueryItem(QStringLiteral("code"), QString::fromLatin1(QUrl::toPercentEncoding(code)));
new_url_query.addQueryItem(QStringLiteral("client_id"), QString::fromLatin1(QUrl::toPercentEncoding(QLatin1String(kClientIDB64))));
new_url_query.addQueryItem(QStringLiteral("client_secret"), QString::fromLatin1(QUrl::toPercentEncoding(QLatin1String(kClientSecretB64))));
new_url_query.addQueryItem(QStringLiteral("client_id"), QString::fromLatin1(QUrl::toPercentEncoding(QString::fromLatin1(QByteArray::fromBase64(kClientIDB64)))));
new_url_query.addQueryItem(QStringLiteral("client_secret"), QString::fromLatin1(QUrl::toPercentEncoding(QString::fromLatin1(QByteArray::fromBase64(kClientSecretB64)))));
new_url_query.addQueryItem(QStringLiteral("redirect_uri"), QString::fromLatin1(QUrl::toPercentEncoding(redirect_url.toString())));
new_url_query.addQueryItem(QStringLiteral("grant_type"), QStringLiteral("authorization_code"));
new_url_query.addQueryItem(QStringLiteral("response_type"), QStringLiteral("code"));