MCPcopy Create free account
hub / github.com/bitwarden/clients / removeAuth

Method removeAuth

libs/angular/src/tools/send/send.component.ts:170–206  ·  view source on GitHub ↗
(s: SendView)

Source from the content-addressed store, hash-verified

168 }
169
170 async removeAuth(s: SendView): Promise<boolean> {
171 if (this.actionPromise != null || s.authType === AuthType.None) {
172 return;
173 }
174
175 const i18nKeys = removeSendAuthI18nKeys(s.authType);
176 const confirmed = await this.dialogService.openSimpleDialog({
177 title: { key: i18nKeys.label },
178 content: { key: i18nKeys.confirmation },
179 type: "warning",
180 });
181
182 if (!confirmed) {
183 return false;
184 }
185
186 try {
187 this.actionPromise = this.sendApiService.removeAuth(s.id);
188 await this.actionPromise;
189 if (this.onSuccessfulRemoveAuth != null) {
190 // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling.
191 // eslint-disable-next-line @typescript-eslint/no-floating-promises
192 this.onSuccessfulRemoveAuth();
193 } else {
194 // Default actions
195 this.toastService.showToast({
196 variant: "success",
197 title: null,
198 message: this.i18nService.t(i18nKeys.removed),
199 });
200 await this.load();
201 }
202 } catch (e) {
203 this.logService.error(e);
204 }
205 this.actionPromise = null;
206 }
207
208 async delete(s: SendView): Promise<boolean> {
209 if (this.actionPromise != null) {

Callers 4

onRemoveAuthMethod · 0.45
runMethod · 0.45
onRemoveAuthMethod · 0.45
removeSendAuthMethod · 0.45

Calls 6

loadMethod · 0.95
removeSendAuthI18nKeysFunction · 0.90
errorMethod · 0.65
openSimpleDialogMethod · 0.45
showToastMethod · 0.45
tMethod · 0.45

Tested by

no test coverage detected