Change user password integration
parent
dc2b98312c
commit
b460d3fbb0
|
|
@ -21,6 +21,7 @@ export class SidebarComponent {
|
||||||
if (token) {
|
if (token) {
|
||||||
try {
|
try {
|
||||||
this.decodedToken = jwtDecode(token);
|
this.decodedToken = jwtDecode(token);
|
||||||
|
console.log('Decoded token:', this.decodedToken);
|
||||||
this.isSuperAdmin = this.decodedToken.roles.includes('ROLE_SUPER_ADMIN');
|
this.isSuperAdmin = this.decodedToken.roles.includes('ROLE_SUPER_ADMIN');
|
||||||
this.username = this.decodedToken.username;
|
this.username = this.decodedToken.username;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,9 @@ export class ChangePasswordModalComponent {
|
||||||
}, { validators: this.passwordMatchValidator });
|
}, { validators: this.passwordMatchValidator });
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit(): void {}
|
ngOnInit(): void {
|
||||||
|
console.log('Data:', this.data);
|
||||||
|
}
|
||||||
|
|
||||||
onNoClick(): void {
|
onNoClick(): void {
|
||||||
this.dialogRef.close();
|
this.dialogRef.close();
|
||||||
|
|
@ -41,12 +43,12 @@ export class ChangePasswordModalComponent {
|
||||||
|
|
||||||
const userPayload = {
|
const userPayload = {
|
||||||
username: this.userForm.value.username,
|
username: this.userForm.value.username,
|
||||||
allowedOrganizationalUnits: this.data.user.allowedOrganizationalUnits,
|
allowedOrganizationalUnits: [],
|
||||||
password: this.userForm.value.password,
|
password: this.userForm.value.password,
|
||||||
enabled: true,
|
enabled: true,
|
||||||
userGroups: this.data.user.userGroups
|
userGroups: []
|
||||||
};
|
};
|
||||||
|
console.log("THIS IS THE USER PAYLOAD: ", userPayload);
|
||||||
this.userService.updateUser(this.data.uuid, userPayload).subscribe(
|
this.userService.updateUser(this.data.uuid, userPayload).subscribe(
|
||||||
response => {
|
response => {
|
||||||
console.log('User updated successfully:', response);
|
console.log('User updated successfully:', response);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue