Authentication composed with Effect.
Keep your identity model. Choose your methods.
import { Effect, Schema } from "effect";
import { Auth, Password } from "effect-auth";
class AppAuth extends Auth.Service<AppAuth>()("app/Auth", {
claims: Schema.Struct({ displayName: Schema.String }),
strategies: { password: Password.make() },
defaultStrategy: "password",
}) {}
export const signIn = Effect.fn("app.signIn")(function* (email: string, password: string) {
const auth = yield* AppAuth;
return yield* auth.signIn({ email, password });
});Supply your account and persistence Layers, configure sessions, and deliver credentials through your request boundary.