กรอง "." ออกจาก firstName ก่อนส่งไป keycloak #2517
This commit is contained in:
parent
238c4c092f
commit
7ebd01ef19
1 changed files with 9 additions and 3 deletions
|
|
@ -4676,8 +4676,10 @@ export class CommandController extends Controller {
|
|||
const _year = new Date(profile.birthDate.toDateString()).getFullYear() + 543;
|
||||
password = `${_date}${_month}${_year}`;
|
||||
}
|
||||
// กรอง "." ออกจาก firstName ก่อนส่งไป keycloak
|
||||
const sanitizedFirstName = profile.firstName?.replace(/\./g, "") ?? "";
|
||||
userKeycloakId = await createUser(profile.citizenId, password, {
|
||||
firstName: profile.firstName,
|
||||
firstName: sanitizedFirstName,
|
||||
lastName: profile.lastName,
|
||||
});
|
||||
const list = await getRoles();
|
||||
|
|
@ -6877,8 +6879,10 @@ export class CommandController extends Controller {
|
|||
}
|
||||
console.log("[Excexute/CreateOfficerProfile] Calling createUser for:", item.bodyProfile.citizenId);
|
||||
console.log("[Excexute/CreateOfficerProfile] createUser data - firstName:", item.bodyProfile.firstName, "lastName:", item.bodyProfile.lastName);
|
||||
// กรอง "." ออกจาก firstName ก่อนส่งไป keycloak (ป้องกัน . หรืออักขระอื่นๆ)
|
||||
const sanitizedFirstName = item.bodyProfile.firstName?.replace(/\./g, "") ?? "";
|
||||
userKeycloakId = await createUser(item.bodyProfile.citizenId, password, {
|
||||
firstName: item.bodyProfile.firstName,
|
||||
firstName: sanitizedFirstName,
|
||||
lastName: item.bodyProfile.lastName,
|
||||
});
|
||||
if (userKeycloakId && typeof userKeycloakId === "object" && userKeycloakId.errorMessage) {
|
||||
|
|
@ -8023,8 +8027,10 @@ export class CommandController extends Controller {
|
|||
const _year = new Date(profile.birthDate.toDateString()).getFullYear() + 543;
|
||||
password = `${_date}${_month}${_year}`;
|
||||
}
|
||||
// กรอง "." ออกจาก firstName ก่อนส่งไป keycloak
|
||||
const sanitizedFirstName = profile.firstName?.replace(/\./g, "") ?? "";
|
||||
const userKeycloakId = await createUser(profile.citizenId, password, {
|
||||
firstName: profile.firstName,
|
||||
firstName: sanitizedFirstName,
|
||||
lastName: profile.lastName,
|
||||
// email: profile.email,
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue