1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-12-11 14:48:46 +01:00

[PM-13202][Defect] MSP name with an apostrophe displaying dummy character in Delete provider screen (#11488)

* Resolve the msp name with apostrophe

* qParams.name exists and is a string before sanitization
This commit is contained in:
cyprain-okeke 2024-12-03 13:46:17 +01:00 committed by GitHub
parent 19663d9587
commit 194aa94302
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,4 +1,5 @@
import { Component, OnInit } from "@angular/core"; import { Component, OnInit, SecurityContext } from "@angular/core";
import { DomSanitizer } from "@angular/platform-browser";
import { ActivatedRoute, Router } from "@angular/router"; import { ActivatedRoute, Router } from "@angular/router";
import { firstValueFrom } from "rxjs"; import { firstValueFrom } from "rxjs";
@ -24,6 +25,7 @@ export class VerifyRecoverDeleteProviderComponent implements OnInit {
private i18nService: I18nService, private i18nService: I18nService,
private route: ActivatedRoute, private route: ActivatedRoute,
private toastService: ToastService, private toastService: ToastService,
private sanitizer: DomSanitizer,
) {} ) {}
async ngOnInit() { async ngOnInit() {
@ -31,7 +33,10 @@ export class VerifyRecoverDeleteProviderComponent implements OnInit {
if (qParams.providerId != null && qParams.token != null && qParams.name != null) { if (qParams.providerId != null && qParams.token != null && qParams.name != null) {
this.providerId = qParams.providerId; this.providerId = qParams.providerId;
this.token = qParams.token; this.token = qParams.token;
this.name = qParams.name; this.name =
qParams.name && typeof qParams.name === "string"
? this.sanitizer.sanitize(SecurityContext.HTML, qParams.name) || ""
: "";
} else { } else {
await this.router.navigate(["/"]); await this.router.navigate(["/"]);
} }