diff --git a/apps/android/src/services/login/index.ts b/apps/android/src/services/login/index.ts new file mode 100644 index 0000000..d325acb --- /dev/null +++ b/apps/android/src/services/login/index.ts @@ -0,0 +1,23 @@ +export { loginFlow, LoginFlow } from './login-flow' +export { githubOAuthLoginChannel, googleOAuthLoginChannel, oauthLoginChannel } from './oauth-channel' +export { passwordLoginChannel, type PasswordLoginInput } from './password-channel' +export type { + ImmediateLoginChannel, + LoginChannelContext, + LoginOutcome, + RedirectLoginChannel, +} from './types' + +import type { RedirectLoginMethod } from '../../types' +import { githubOAuthLoginChannel, googleOAuthLoginChannel, oauthLoginChannel } from './oauth-channel' +import type { RedirectLoginChannel } from './types' + +export const redirectLoginChannels: Record = { + oauth: oauthLoginChannel, + 'github-oauth': githubOAuthLoginChannel, + 'google-oauth': googleOAuthLoginChannel, +} + +export function redirectLoginChannelFor(method: RedirectLoginMethod | undefined): RedirectLoginChannel { + return redirectLoginChannels[method ?? 'oauth'] +}