Change user password integration

pull/3/head
Alvaro Puente Mella 2024-06-14 11:14:32 +02:00
parent dc2b98312c
commit b460d3fbb0
2 changed files with 7 additions and 4 deletions

View File

@ -21,6 +21,7 @@ export class SidebarComponent {
if (token) {
try {
this.decodedToken = jwtDecode(token);
console.log('Decoded token:', this.decodedToken);
this.isSuperAdmin = this.decodedToken.roles.includes('ROLE_SUPER_ADMIN');
this.username = this.decodedToken.username;
} catch (error) {

View File

@ -28,7 +28,9 @@ export class ChangePasswordModalComponent {
}, { validators: this.passwordMatchValidator });
}
ngOnInit(): void {}
ngOnInit(): void {
console.log('Data:', this.data);
}
onNoClick(): void {
this.dialogRef.close();
@ -41,12 +43,12 @@ export class ChangePasswordModalComponent {
const userPayload = {
username: this.userForm.value.username,
allowedOrganizationalUnits: this.data.user.allowedOrganizationalUnits,
allowedOrganizationalUnits: [],
password: this.userForm.value.password,
enabled: true,
userGroups: this.data.user.userGroups
userGroups: []
};
console.log("THIS IS THE USER PAYLOAD: ", userPayload);
this.userService.updateUser(this.data.uuid, userPayload).subscribe(
response => {
console.log('User updated successfully:', response);