Skip to content

Commit 75b9509

Browse files
Merge pull request #394 from torusresearch/feat/add-new-authentication-types
Adds new authentication types
2 parents 6118b5c + 046b97d commit 75b9509

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

src/handlers/HandlerFactory.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ const createHandler = (params: CreateHandlerParams): ILoginHandler => {
3939
case AUTH_CONNECTION.LINE:
4040
case AUTH_CONNECTION.CUSTOM:
4141
case AUTH_CONNECTION.REDDIT:
42+
case AUTH_CONNECTION.WECHAT:
43+
case AUTH_CONNECTION.KAKAO:
44+
case AUTH_CONNECTION.FARCASTER:
45+
case AUTH_CONNECTION.AUTHENTICATOR:
4246
if (id_token || access_token) {
4347
return new MockLoginHandler(params);
4448
}

src/utils/enums.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,13 @@ export const AUTH_CONNECTION = {
1414
LINE: "line",
1515
EMAIL_PASSWORDLESS: "email_passwordless",
1616
SMS_PASSWORDLESS: "sms_passwordless",
17+
KAKAO: "kakao",
18+
WECHAT: "wechat",
19+
FARCASTER: "farcaster",
1720
// end - byoa
1821
CUSTOM: "custom",
1922
PASSKEYS: "passkeys",
23+
AUTHENTICATOR: "authenticator",
2024
} as const;
2125

2226
export const UX_MODE = {

src/utils/helpers.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,17 @@ export const getUserId = (
6666
switch (authConnection) {
6767
case AUTH_CONNECTION.EMAIL_PASSWORDLESS:
6868
case AUTH_CONNECTION.SMS_PASSWORDLESS:
69+
case AUTH_CONNECTION.AUTHENTICATOR:
6970
return caseSensitiveField(name, isUserIdCaseSensitive);
7071
case AUTH_CONNECTION.WEIBO:
7172
case AUTH_CONNECTION.GITHUB:
7273
case AUTH_CONNECTION.TWITTER:
7374
case AUTH_CONNECTION.APPLE:
7475
case AUTH_CONNECTION.LINKEDIN:
7576
case AUTH_CONNECTION.LINE:
77+
case AUTH_CONNECTION.WECHAT:
78+
case AUTH_CONNECTION.KAKAO:
79+
case AUTH_CONNECTION.FARCASTER:
7680
case AUTH_CONNECTION.CUSTOM:
7781
return caseSensitiveField(sub, isUserIdCaseSensitive);
7882
default:

0 commit comments

Comments
 (0)