import { User } from "../user.js";
import { AuthError, Result } from "./utils.js";

//#region src/auth/methods/magicLink.d.ts

/**
 * Signs a visitor in with the token from a magic link they followed.
 *
 * The token keeps working after it is used, so anyone holding the link can sign
 * in as that visitor. Never log it, and redirect away from the URL that carried
 * it.
 *
 */
declare function signInWithMagicLink(credentials: {
  token: string;
}): Promise<Result<{
  status: "signedIn";
  user: User;
} | {
  status: "authenticatorRequired";
  step: "verify" | "setup" | "setupOptional";
}, AuthError>>;
//#endregion
export { signInWithMagicLink };