aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/src/main/java/github/daneren2005/dsub/util/Util.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/app/src/main/java/github/daneren2005/dsub/util/Util.java b/app/src/main/java/github/daneren2005/dsub/util/Util.java
index 24895226..e90bfa06 100644
--- a/app/src/main/java/github/daneren2005/dsub/util/Util.java
+++ b/app/src/main/java/github/daneren2005/dsub/util/Util.java
@@ -417,12 +417,13 @@ public final class Util {
builder.append("rest/").append(method).append(".view");
builder.append("?u=").append(username);
if(method != null && ServerInfo.canUseToken(context, instance)) {
- Pair<String, String> values = tokens.get(instance);
+ int hash = (username + password).hashCode();
+ Pair<String, String> values = tokens.get(hash);
if(values == null) {
String salt = new BigInteger(130, getRandom()).toString(32);
String token = md5Hex(password + salt);
values = new Pair<>(salt, token);
- tokens.put(instance, values);
+ tokens.put(hash, values);
}
builder.append("&s=").append(values.getFirst());