Selaa lähdekoodia

id is always sent be server

Manav Rathi 1 vuosi sitten
vanhempi
commit
650163c341

+ 2 - 2
web/apps/auth/src/pages/auth.tsx

@@ -161,11 +161,11 @@ const AuthNavbar: React.FC = () => {
     );
 };
 
-interface CodeDisplay {
+interface CodeDisplayProps {
     code: Code;
 }
 
-const CodeDisplay: React.FC<CodeDisplay> = ({ code }) => {
+const CodeDisplay: React.FC<CodeDisplayProps> = ({ code }) => {
     const [otp, setOTP] = useState("");
     const [nextOTP, setNextOTP] = useState("");
     const [errorMessage, setErrorMessage] = useState("");

+ 1 - 1
web/apps/auth/src/services/code.ts

@@ -9,7 +9,7 @@ import { Steam } from "./steam";
  */
 export interface Code {
     /** A unique id for the corresponding "auth entity" in our system. */
-    id?: String;
+    id: string;
     /** The type of the code. */
     type: "totp" | "hotp" | "steam";
     /** The user's account or email for which this code is used. */

+ 1 - 0
web/apps/auth/src/services/remote.ts

@@ -26,6 +26,7 @@ export const getAuthCodes = async (): Promise<Code[]> => {
             authEntity
                 .filter((f) => !f.isDeleted)
                 .map(async (entity) => {
+                    if (!entity.id) return undefined;
                     if (!entity.encryptedData) return undefined;
                     if (!entity.header) return undefined;
                     try {