corrected username check and dropdown size, see #57
This commit is contained in:
@@ -94,7 +94,7 @@ public class RegistrationRepository {
|
||||
SelectConditionStep<TProfileRecord> sql = jooq
|
||||
// @formatter:off
|
||||
.selectFrom(T_PROFILE)
|
||||
.where(T_PROFILE.USERNAME.eq(login));
|
||||
.where(DSL.lower(T_PROFILE.USERNAME).eq(login));
|
||||
// @formatter:on
|
||||
LOGGER.debug(sql);
|
||||
return sql.fetch().size() < 1;
|
||||
@@ -111,9 +111,9 @@ public class RegistrationRepository {
|
||||
LambdaResultWrapper lrw = new LambdaResultWrapper();
|
||||
jooq.transaction(t -> {
|
||||
if (bean.getLogin() != null && !bean.getLogin().isEmpty()) {
|
||||
Boolean loginNotYetInUse = isLoginNotYetInUse(bean.getLogin());
|
||||
Boolean loginNotYetInUse = isLoginNotYetInUse(bean.getLogin().toLowerCase());
|
||||
if (bean.getRegisterInKeycloak() && !loginNotYetInUse) {
|
||||
throw new DataAccessException("login already in use: " + bean.getLogin());
|
||||
throw new DataAccessException("login already in use: " + bean.getLogin().toLowerCase());
|
||||
}
|
||||
Integer fkProfile = null;
|
||||
if (loginNotYetInUse) {
|
||||
@@ -127,7 +127,7 @@ public class RegistrationRepository {
|
||||
T_PROFILE.PASSWORD,
|
||||
T_PROFILE.DUEDATE,
|
||||
T_PROFILE.UUID)
|
||||
.values(bean.getForename(), bean.getSurname(), bean.getLogin(), oldPassword, LocalDateTime.now().plus(356, ChronoUnit.DAYS), UUID.nameUUIDFromBytes(bean.getLogin().getBytes()).toString())
|
||||
.values(bean.getForename(), bean.getSurname(), bean.getLogin().toLowerCase(), oldPassword, LocalDateTime.now().plus(356, ChronoUnit.DAYS), UUID.nameUUIDFromBytes(bean.getLogin().getBytes()).toString())
|
||||
.returning(T_PROFILE.PK);
|
||||
// @formatter:on
|
||||
LOGGER.debug(sql1.toString());
|
||||
@@ -147,7 +147,7 @@ public class RegistrationRepository {
|
||||
// @formatter:off
|
||||
.select(T_PROFILE.PK)
|
||||
.from(T_PROFILE)
|
||||
.where(T_PROFILE.USERNAME.eq(bean.getLogin()));
|
||||
.where(DSL.lower(T_PROFILE.USERNAME).eq(bean.getLogin().toLowerCase()));
|
||||
// @formatter:on
|
||||
LOGGER.debug(sql1.toString());
|
||||
fkProfile = sql1.fetchOne().get(T_PROFILE.PK);
|
||||
|
||||
Reference in New Issue
Block a user