@e280/authlocal
Version:
User-sovereign login system for everybody
21 lines (15 loc) • 531 B
text/typescript
import {register} from "@benev/slate"
import {Auth} from "./auth.js"
import {AuthOptions} from "./types.js"
import {appElements} from "./elements/elements.js"
import {commonElements} from "../common/elements/elements.js"
export async function prepareElements(auth: Auth) {
return {...commonElements, ...appElements(auth)}
}
export async function install(options?: Partial<AuthOptions>) {
const auth = new Auth(options)
const elements = await prepareElements(auth)
await auth.loadLogin()
register(elements)
return auth
}