mirror of
https://gitea.mayex.net/mayekkuzu/Audinaut.git
synced 2025-01-23 17:24:54 +03:00
Use p= authentication parameter when authMethod is false.
This commit is contained in:
parent
4254c8ad9f
commit
5141eb6e81
@ -323,18 +323,24 @@ public final class Util {
|
|||||||
builder.addPathSegment("rest");
|
builder.addPathSegment("rest");
|
||||||
builder.addPathSegment(method + ".view");
|
builder.addPathSegment(method + ".view");
|
||||||
|
|
||||||
int hash = (username + password).hashCode();
|
builder.addQueryParameter("u", username);
|
||||||
Pair<String, String> values = tokens.get(hash);
|
|
||||||
if (values == null) {
|
if (prefs.getBoolean(Constants.PREFERENCES_KEY_AUTH_METHOD, true)) {
|
||||||
String salt = new BigInteger(130, getRandom()).toString(32);
|
int hash = (username + password).hashCode();
|
||||||
String token = md5Hex(password + salt);
|
Pair<String, String> values = tokens.get(hash);
|
||||||
values = new Pair<>(salt, token);
|
if (values == null) {
|
||||||
tokens.put(hash, values);
|
String salt = new BigInteger(130, getRandom()).toString(32);
|
||||||
|
String token = md5Hex(password + salt);
|
||||||
|
values = new Pair<>(salt, token);
|
||||||
|
tokens.put(hash, values);
|
||||||
|
}
|
||||||
|
|
||||||
|
builder.addQueryParameter("s", values.getFirst());
|
||||||
|
builder.addQueryParameter("t", values.getSecond());
|
||||||
|
} else {
|
||||||
|
builder.addQueryParameter("p", password);
|
||||||
}
|
}
|
||||||
|
|
||||||
builder.addQueryParameter("u", username);
|
|
||||||
builder.addQueryParameter("s", values.getFirst());
|
|
||||||
builder.addQueryParameter("t", values.getSecond());
|
|
||||||
builder.addQueryParameter("v", Constants.REST_PROTOCOL_VERSION_SUBSONIC);
|
builder.addQueryParameter("v", Constants.REST_PROTOCOL_VERSION_SUBSONIC);
|
||||||
builder.addQueryParameter("c", Constants.REST_CLIENT_ID);
|
builder.addQueryParameter("c", Constants.REST_CLIENT_ID);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user