supertokens-node
    Preparing search index...
    checkCode: (
        input:
            | {
                deviceId: string;
                preAuthSessionId: string;
                tenantId: string;
                userContext?: Record<string, any>;
                userInputCode: string;
            }
            | {
                linkCode: string;
                preAuthSessionId: string;
                tenantId: string;
                userContext?: Record<string, any>;
            },
    ) => Promise<
        | {
            consumedDevice: {
                email?: string;
                failedCodeInputAttemptCount: number;
                phoneNumber?: string;
                preAuthSessionId: string;
            };
            status: "OK";
        }
        | {
            failedCodeInputAttemptCount: number;
            maximumCodeInputAttempts: number;
            status: | "INCORRECT_USER_INPUT_CODE_ERROR"
            | "EXPIRED_USER_INPUT_CODE_ERROR";
        }
        | { status: "RESTART_FLOW_ERROR" },
    > = Wrapper.checkCode

    Type declaration

      • (
            input:
                | {
                    deviceId: string;
                    preAuthSessionId: string;
                    tenantId: string;
                    userContext?: Record<string, any>;
                    userInputCode: string;
                }
                | {
                    linkCode: string;
                    preAuthSessionId: string;
                    tenantId: string;
                    userContext?: Record<string, any>;
                },
        ): Promise<
            | {
                consumedDevice: {
                    email?: string;
                    failedCodeInputAttemptCount: number;
                    phoneNumber?: string;
                    preAuthSessionId: string;
                };
                status: "OK";
            }
            | {
                failedCodeInputAttemptCount: number;
                maximumCodeInputAttempts: number;
                status: | "INCORRECT_USER_INPUT_CODE_ERROR"
                | "EXPIRED_USER_INPUT_CODE_ERROR";
            }
            | { status: "RESTART_FLOW_ERROR" },
        >
      • This function will only verify the code (not consume it), and: NOT create a new user if it doesn't exist NOT verify the user email if it exists NOT do any linking NOT delete the code unless it returned RESTART_FLOW_ERROR

        Parameters

        • input:
              | {
                  deviceId: string;
                  preAuthSessionId: string;
                  tenantId: string;
                  userContext?: Record<string, any>;
                  userInputCode: string;
              }
              | {
                  linkCode: string;
                  preAuthSessionId: string;
                  tenantId: string;
                  userContext?: Record<string, any>;
              }

        Returns Promise<
            | {
                consumedDevice: {
                    email?: string;
                    failedCodeInputAttemptCount: number;
                    phoneNumber?: string;
                    preAuthSessionId: string;
                };
                status: "OK";
            }
            | {
                failedCodeInputAttemptCount: number;
                maximumCodeInputAttempts: number;
                status: | "INCORRECT_USER_INPUT_CODE_ERROR"
                | "EXPIRED_USER_INPUT_CODE_ERROR";
            }
            | { status: "RESTART_FLOW_ERROR" },
        >