Skip to content

Commit

Permalink
fix: query fix (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
sattvikc authored Oct 12, 2023
1 parent c8c3948 commit cddaad1
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [5.0.1] - 2023-10-12

- Fixes user info from primary user id query
- Fixes `deviceIdHash` issue

## [5.0.0] - 2023-09-19

### Changes
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plugins {
id 'java-library'
}

version = "5.0.0"
version = "5.0.1"

repositories {
mavenCentral()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1183,7 +1183,7 @@ private static List<AuthRecipeUserInfo> getPrimaryUserInfoForUserIds(Start start
" WHERE au.primary_or_recipe_user_id IN (SELECT primary_or_recipe_user_id FROM " +
Config.getConfig(start).getAppIdToUserIdTable() + " WHERE (user_id IN ("
+ Utils.generateCommaSeperatedQuestionMarks(userIds.size()) +
") OR au.primary_or_recipe_user_id IN (" +
") OR primary_or_recipe_user_id IN (" +
Utils.generateCommaSeperatedQuestionMarks(userIds.size()) +
")) AND app_id = ?) AND au.app_id = ?";

Expand Down Expand Up @@ -1275,7 +1275,7 @@ private static List<AuthRecipeUserInfo> getPrimaryUserInfoForUserIds_Transaction
" WHERE au.primary_or_recipe_user_id IN (SELECT primary_or_recipe_user_id FROM " +
Config.getConfig(start).getAppIdToUserIdTable() + " WHERE (user_id IN ("
+ Utils.generateCommaSeperatedQuestionMarks(userIds.size()) +
") OR au.primary_or_recipe_user_id IN (" +
") OR primary_or_recipe_user_id IN (" +
Utils.generateCommaSeperatedQuestionMarks(userIds.size()) +
")) AND app_id = ?) AND au.app_id = ?";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1115,7 +1115,7 @@ private static PasswordlessDeviceRowMapper getInstance() {

@Override
public PasswordlessDevice map(ResultSet result) throws Exception {
return new PasswordlessDevice(result.getString("device_id_hash"), result.getString("email"),
return new PasswordlessDevice(result.getString("device_id_hash").trim(), result.getString("email"),
result.getString("phone_number"), result.getString("link_code_salt"),
result.getInt("failed_attempts"));
}
Expand All @@ -1133,7 +1133,7 @@ private static PasswordlessCodeRowMapper getInstance() {

@Override
public PasswordlessCode map(ResultSet result) throws Exception {
return new PasswordlessCode(result.getString("code_id"), result.getString("device_id_hash"),
return new PasswordlessCode(result.getString("code_id"), result.getString("device_id_hash").trim(),
result.getString("link_code_hash"), result.getLong("created_at"));
}
}
Expand Down

0 comments on commit cddaad1

Please sign in to comment.