diff options
author | Scott Jackson <daneren2005@gmail.com> | 2015-09-12 17:48:21 -0700 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2015-09-12 17:48:21 -0700 |
commit | e7062e98e77991a8f32cffcb4f0942b88e370bf0 (patch) | |
tree | bf48a704b6e567e74275421afeaf368cf2081757 /app/src | |
parent | 981a0c6ab6bc9b7da67cf60076064f291a39de49 (diff) | |
download | dsub-e7062e98e77991a8f32cffcb4f0942b88e370bf0.tar.gz dsub-e7062e98e77991a8f32cffcb4f0942b88e370bf0.tar.bz2 dsub-e7062e98e77991a8f32cffcb4f0942b88e370bf0.zip |
Fix tokens not being refreshed when changing username/password
Diffstat (limited to 'app/src')
-rw-r--r-- | app/src/main/java/github/daneren2005/dsub/util/Util.java | 5 |
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()); |