import { IApiSuccess } from '../../api.models';
import { ITenant } from '../../common.models';

export interface INeedWebAuthn {
    publicKey: {
        timeout: number;
        challenge: string;
        userVerification: string;
        rpId: string;
        allowCredentials: {
            id: string;
            transports: string[];
            type: string;
        }[];
    };
    u2fUrl: string;
    token: string;
}
export interface INeedOAuth2 extends IApiSuccess {
    redirectURI: string;
    name: string;
    providerName: string;
    providerImageURI: string;
}
export interface ICredentials {
    login: string;
    pass?: string;
    otherCredentialsWebAuthn?: string;
    otherCredentialsOAuth2?: string;
}
export interface ILoginResponse extends IApiSuccess {
    needMoreCredentialsOtp: boolean;
    needMoreCredentialsU2F: boolean;
    needMoreCredentialsWebAuthn: INeedWebAuthn;
    needMoreCredentialsOAuth2: INeedOAuth2;
    redirectUrl: string;
    sessionId: string;
    tenantId: number;
    loggedOutCnt: number;
}
export interface IValidTenantResponse extends ILoginResponse {
    tenants: ITenant[];
}
export interface IForgotPassword {
    email: string;
    gRecaptchaResponse: string;
}
export interface ISetNewPassword {
    token: string;
    pass: string;
    passvalid: string;
}
export interface ISetNewPasswordResponse extends IApiSuccess {
    login: string;
}
