We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9507080 commit c8543ddCopy full SHA for c8543dd
springboot-starter-security/src/main/java/com/codingapi/springboot/security/redis/RedisTokenGateway.java
@@ -8,6 +8,7 @@
8
import java.util.Set;
9
import java.util.UUID;
10
import java.util.concurrent.TimeUnit;
11
+import java.util.function.Predicate;
12
13
public class RedisTokenGateway {
14
@@ -48,5 +49,17 @@ public void removeUsername(String username) {
48
49
}
50
51
52
+ public void removeUsername(String username, Predicate<Token> predicate) {
53
+ Set<String> keys = redisTemplate.keys(username + ":*");
54
+ if (keys != null && !keys.isEmpty()) {
55
+ for (String key : keys) {
56
+ Token token = parser(key);
57
+ if (token != null && predicate.test(token)) {
58
+ redisTemplate.delete(key);
59
+ }
60
61
62
63
+
64
65
0 commit comments