From 9435be3bf52ba2327d884cf3518fb3b21f37ab95 Mon Sep 17 00:00:00 2001 From: Sattvik Chakravarthy Date: Thu, 12 Oct 2023 19:40:20 +0530 Subject: [PATCH] Query fix (#166) * fix: query fix * fix: passwordless --- CHANGELOG.md | 1 + .../storage/postgresql/queries/PasswordlessQueries.java | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 69ef7e9d..a01447b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [5.0.1] - 2023-10-12 - Fixes user info from primary user id query +- Fixes `deviceIdHash` issue ## [5.0.0] - 2023-09-19 diff --git a/src/main/java/io/supertokens/storage/postgresql/queries/PasswordlessQueries.java b/src/main/java/io/supertokens/storage/postgresql/queries/PasswordlessQueries.java index 31858944..8f8df3d6 100644 --- a/src/main/java/io/supertokens/storage/postgresql/queries/PasswordlessQueries.java +++ b/src/main/java/io/supertokens/storage/postgresql/queries/PasswordlessQueries.java @@ -1112,7 +1112,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")); } @@ -1130,7 +1130,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")); } }