Skip to content

Commit 8c96a9b

Browse files
sync
1 parent 1569f28 commit 8c96a9b

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Client, Account, } from "appwrite";
1+
import { Client, Account, AuthenticationFactor } from "appwrite";
22

33
const client = new Client()
44
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
@@ -7,7 +7,7 @@ const client = new Client()
77
const account = new Account(client);
88

99
const result = await account.createChallenge(
10-
.Totp // factor
10+
AuthenticationFactor.Totp // factor
1111
);
1212

1313
console.log(response);

src/enums/factor.ts renamed to src/enums/authentication-factor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export enum Factor {
1+
export enum AuthenticationFactor {
22
Totp = 'totp',
33
Phone = 'phone',
44
Email = 'email',

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export type { QueryTypes, QueryTypesList } from './query';
1313
export { Permission } from './permission';
1414
export { Role } from './role';
1515
export { ID } from './id';
16-
export { Factor } from './enums/factor';
16+
export { AuthenticationFactor } from './enums/authentication-factor';
1717
export { AuthenticatorType } from './enums/authenticator-type';
1818
export { OAuthProvider } from './enums/o-auth-provider';
1919
export { Browser } from './enums/browser';

src/services/account.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { AppwriteException, Client } from '../client';
33
import type { Models } from '../models';
44
import type { UploadProgress, Payload } from '../client';
55
import { Query } from '../query';
6-
import { Factor } from '../enums/factor';
6+
import { AuthenticationFactor } from '../enums/authentication-factor';
77
import { AuthenticatorType } from '../enums/authenticator-type';
88
import { OAuthProvider } from '../enums/o-auth-provider';
99

@@ -253,11 +253,11 @@ export class Account extends Service {
253253
* Create 2FA Challenge
254254
*
255255
*
256-
* @param {Factor} factor
256+
* @param {AuthenticationFactor} factor
257257
* @throws {AppwriteException}
258258
* @returns {Promise}
259259
*/
260-
async createChallenge(factor: Factor): Promise<Models.MfaChallenge> {
260+
async createChallenge(factor: AuthenticationFactor): Promise<Models.MfaChallenge> {
261261
if (typeof factor === 'undefined') {
262262
throw new AppwriteException('Missing required parameter: "factor"');
263263
}

0 commit comments

Comments
 (0)