Skip to content

Commit

Permalink
restrict passkeys, authenticator login methods
Browse files Browse the repository at this point in the history
  • Loading branch information
chaitanyapotti committed Sep 27, 2024
1 parent 79c14ee commit 30c28ee
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions packages/ui/src/components/SocialLogins.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ export default function SocialLogins(props: SocialLoginProps) {
LOGIN_PROVIDER.JWT,
LOGIN_PROVIDER.SMS_PASSWORDLESS,
LOGIN_PROVIDER.EMAIL_PASSWORDLESS,
LOGIN_PROVIDER.AUTHENTICATOR,
LOGIN_PROVIDER.PASSKEYS,
];

return (
Expand Down
8 changes: 7 additions & 1 deletion packages/ui/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ export function capitalizeFirstLetter(string: string): string {
return string.charAt(0).toUpperCase() + string.slice(1);
}

export const AUTH_PROVIDERS = Object.values(LOGIN_PROVIDER).filter((x) => x !== LOGIN_PROVIDER.WEBAUTHN && x !== LOGIN_PROVIDER.JWT);
const restrictedLoginMethods: Set<LOGIN_PROVIDER_TYPE> = new Set([
LOGIN_PROVIDER.AUTHENTICATOR,
LOGIN_PROVIDER.PASSKEYS,
LOGIN_PROVIDER.JWT,
LOGIN_PROVIDER.WEBAUTHN,
]);
export const AUTH_PROVIDERS = Object.values(LOGIN_PROVIDER).filter((x) => !restrictedLoginMethods.has(x));

export const AUTH_PROVIDERS_NAMES = AUTH_PROVIDERS.reduce(
(acc, x) => {
Expand Down

0 comments on commit 30c28ee

Please sign in to comment.