Skip to content
Snippets Groups Projects
Commit a3892654 authored by Alexandre Eberhardt's avatar Alexandre Eberhardt
Browse files

Profile Names: Correctly resolve the first and last names.

searchUserProfiles does a LIKE SQL query, which may return multiple user profiles.
It then selects the first result, which could belong to a different user with a longer name.
e.g. if both Michel and Michelle are registered, Michel is incorrectly resolved as Michelle.

GitLab: #135
Change-Id: Ib9bacb8e6cb2fc747ea7d4acd206b0841deea37d
parent 92b54295
No related branches found
No related tags found
No related merge requests found
......@@ -35,7 +35,6 @@ import net.jami.jams.dht.DeviceReceiptGenerator;
import java.security.cert.X509Certificate;
import java.util.Date;
import java.util.Optional;
@Slf4j
public class RegisterDeviceFlow {
......@@ -49,8 +48,7 @@ public class RegisterDeviceFlow {
userAuthenticationModule
.getAuthSources()
.get(new AuthModuleKey(user.getRealm(), user.getUserType()))
.searchUserProfiles(username, "LOGON_NAME", Optional.empty())
.get(0);
.getUserProfile(username);
// Renew user certificate if expired with same private key
if (!user.getCertificate().getNotAfter().after(new Date())) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment