@softr/sdk
Version:
The SDK for building Softr apps on TanStack Start. It lets an app interact with Softr: auth, datasources, workflows and integrations.
27 lines (26 loc) • 1.07 kB
TypeScript
import { AuthError, Result } from "./utils.js";
//#region src/auth/methods/signInMethod.d.ts
type SignInMethod = "password" | "emailCode" | "google" | "sso";
/**
* How a visitor with this email signs in, for a login page that asks for the
* email first and routes from there.
*
* `account` is `none` when the email has no account, and `deactivated` for a
* deactivated one. For an `active` account, `methods` lists what the app
* offers and also works for that account, in the order to prefer them.
* `passwordSet` is false when the account has no password yet: `password` is
* then listed after the methods that work right away, and the visitor sets
* one through the password reset first. `methods` can be empty when nothing
* the app offers works for the account.
*
* It tells anyone who asks whether an email has an account.
*/
declare function signInMethod(details: {
email: string;
}): Promise<Result<{
account: "none" | "deactivated" | "active";
methods: SignInMethod[];
passwordSet: boolean;
}, AuthError>>;
//#endregion
export { signInMethod };