1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-09 13:10:17 +00:00

Use TwoFactorAuthData import instead of separate interface

This commit is contained in:
Alec Rippberger
2025-04-15 16:15:20 -05:00
parent d0c1f6d662
commit 73a6f059a8

View File

@@ -46,7 +46,7 @@ import {
ToastService,
} from "@bitwarden/components";
import { TwoFactorAuthComponentCacheService } from "../../common/services/auth-request/two-factor-auth-cache.service";
import { TwoFactorAuthComponentCacheService , TwoFactorAuthData } from "../../common/services/auth-request/two-factor-auth-cache.service";
import { AnonLayoutWrapperDataService } from "../anon-layout/anon-layout-wrapper-data.service";
import {
TwoFactorAuthAuthenticatorIcon,
@@ -71,15 +71,6 @@ import {
TwoFactorOptionsDialogResult,
} from "./two-factor-options.component";
/**
* Interface for the cache data structure
*/
interface TwoFactorCacheData {
token?: string;
remember?: boolean;
selectedProviderType?: TwoFactorProviderType;
}
@Component({
standalone: true,
selector: "app-two-factor-auth",
@@ -222,7 +213,7 @@ export class TwoFactorAuthComponent implements OnInit, OnDestroy {
/**
* Save specific form data fields to the cache
*/
async saveFormDataWithPartialData(data: Partial<TwoFactorCacheData>) {
async saveFormDataWithPartialData(data: Partial<TwoFactorAuthData>) {
// Get current cached data
const currentData = this.twoFactorCacheService.getCachedData();
@@ -240,7 +231,7 @@ export class TwoFactorAuthComponent implements OnInit, OnDestroy {
* Save all current form data to the cache
*/
async saveFormData() {
const formData: TwoFactorCacheData = {
const formData: TwoFactorAuthData = {
token: this.tokenFormControl.value || undefined,
remember: this.rememberFormControl.value ?? undefined,
selectedProviderType: this.selectedProviderType,