Added redirect after user credentials change
This commit is contained in:
@ -4,6 +4,7 @@ import axios from "axios";
|
||||
import {firstValueFrom} from "rxjs";
|
||||
import {DevelopmentStore} from "../../../store/DevelopmentStore";
|
||||
import {AuthStore} from "../../../store/authStore";
|
||||
import {Router} from "@angular/router";
|
||||
|
||||
@Component({
|
||||
selector: 'app-edituser',
|
||||
@ -21,7 +22,7 @@ export class EdituserComponent {
|
||||
newPassword: string = "";
|
||||
confirmNewPassword: string = "";
|
||||
|
||||
constructor(private developmentStore: DevelopmentStore, private authStore: AuthStore) {}
|
||||
constructor(private developmentStore: DevelopmentStore, private authStore: AuthStore, private router: Router) {}
|
||||
|
||||
async saveUser() {
|
||||
|
||||
@ -46,8 +47,9 @@ export class EdituserComponent {
|
||||
newPasswordConfirm: this.confirmNewPassword
|
||||
}
|
||||
});
|
||||
// TODO: Implement backend logic for this
|
||||
console.log("User updated successfully");
|
||||
alert("User updated successfully. Please log in again to continue.");
|
||||
await this.router.navigate(['/login']);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
|
Reference in New Issue
Block a user