Skip to content

Commit f2471e2

Browse files
authored
fix: user search (#249)
1 parent 6e5e928 commit f2471e2

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

88
## [Unreleased]
99

10+
## [8.0.2]
11+
12+
- Fixes `NullPointerException` in user search API
13+
1014
## [8.0.1]
1115

1216
- Fixes slow queries for account linking

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ plugins {
22
id 'java-library'
33
}
44

5-
version = "8.0.1"
5+
version = "8.0.2"
66

77
repositories {
88
mavenCentral()

src/main/java/io/supertokens/storage/postgresql/queries/GeneralQueries.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -959,7 +959,7 @@ public static AuthRecipeUserInfo[] getUsers(Start start, TenantIdentifier tenant
959959
// attach email tags to queries
960960
QUERY = QUERY +
961961
" WHERE (emailpasswordTable.app_id = ? AND emailpasswordTable.tenant_id = ?) AND"
962-
+ " (emailpasswordTable.email LIKE ? OR emailpasswordTable.email LIKE ?)";
962+
+ " ( emailpasswordTable.email LIKE ? OR emailpasswordTable.email LIKE ? ";
963963
queryList.add(tenantIdentifier.getAppId());
964964
queryList.add(tenantIdentifier.getTenantId());
965965
queryList.add(dashboardSearchTags.emails.get(0) + "%");
@@ -970,6 +970,8 @@ public static AuthRecipeUserInfo[] getUsers(Start start, TenantIdentifier tenant
970970
queryList.add("%@" + dashboardSearchTags.emails.get(i) + "%");
971971
}
972972

973+
QUERY += " )";
974+
973975
USER_SEARCH_TAG_CONDITION.append("SELECT * FROM ( ").append(QUERY)
974976
.append(" LIMIT 1000) AS emailpasswordResultTable");
975977
}

0 commit comments

Comments
 (0)