@@ -55,7 +55,7 @@ export interface VRChatOptions extends Omit<NonNullable<Parameters<typeof create
55
55
credentials ?: Lazy < LoginCredentials > ;
56
56
/**
57
57
* If set to `true`, the client will attempt to authenticate immediately after being created.
58
- * If set to `false` or not provided , the client will only re-authenticate on request failure (e.g. 401 Unauthorized).
58
+ * If set to `false`, the client will only re-authenticate on request failure (e.g. 401 Unauthorized).
59
59
* @default true
60
60
*/
61
61
optimistic ?: boolean ;
@@ -79,7 +79,9 @@ export interface LoginCredentials {
79
79
*/
80
80
password : string ;
81
81
/**
82
- * The secret key for two-factor authentication.
82
+ * The secret key for two-factor authentication, useful for service accounts & automated workflows.
83
+ * If this is a user-initiated login, don't use this.
84
+ *
83
85
* Equivalent to ``twoFactorCode: TOTP.generate(totpSecret).otp``.
84
86
*/
85
87
totpSecret ?: string ;
@@ -370,8 +372,8 @@ export class VRChat extends VRChatInternal {
370
372
371
373
const factors = await Promise . all ( [
372
374
twoFactorMethods . includes ( "totp" ) ? this . verify2Fa . bind ( this ) : undefined ,
373
- // this.verify2FaEmailCode.bind(this),
374
- // this.verifyRecoveryCode.bind(this)
375
+ twoFactorMethods . includes ( "otp" ) ? this . verify2FaEmailCode . bind ( this ) : undefined ,
376
+ twoFactorMethods . includes ( "otp" ) ? this . verifyRecoveryCode . bind ( this ) : undefined
375
377
] . filter ( Boolean ) . map ( ( function_ ) => function_ ?.( {
376
378
...options ,
377
379
throwOnError : false ,
0 commit comments