EmailPassword.ts overview
Email and password over WorkOS: sign-up creates the WorkOS user, sign-in is the password grant, and the session is the sealed cookie (WorkOSSessions.issue). The core’s hooks run at the core’s points, so the abuse plugins keep guarding sign-in. Also the AuthLifecycleService the HTTP tier signs in through, and the PasswordHasher it requires, which refuses: WorkOS holds every password.
Since v0.1.0
Exports Grouped by Category
layers
authLifecycleLayer
The core AuthLifecycleService over this package’s email and password and email verification. A sign-up whose address WorkOS requires verified answers needsEmailVerification: true and no session; WorkOS has emailed the code. verifyEmail takes <userId>:<code> (see EmailVerification) and signs nobody in: the user signs in again.
Signature
declare const authLifecycleLayer: Layer.Layer<
Auth.AuthLifecycle.AuthLifecycleService,
never,
Auth.UserStore.UserStore | Auth.Email.EmailPasswordService | Auth.Email.EmailVerificationService
>
Since v0.1.0
emailPasswordLayer
The core EmailPasswordService over WorkOS.
setPassword and clearPassword are refused: WorkOS does not tell whether a user has a password, so neither could keep the core’s rule that an existing password is changed only with the current one. A sign-up’s attributes are not stored (WorkOS has no attribute bag; write metadata through UserService.updateUserAttributes).
Signature
declare const emailPasswordLayer: Layer.Layer<
Auth.Email.EmailPasswordService,
never,
WorkOSClient | WorkOSSessions | WorkOSAuthenticate | Auth.SessionService.SessionService | Auth.Hooks.Hooks
>
Since v0.1.0
refusingHasherLayer
The PasswordHasher the HTTP tier requires. WorkOS hashes and checks every password, so nothing here should reach it; a call fails rather than hash a password the backend would never read.
Signature
declare const refusingHasherLayer: Layer.Layer<Auth.Password.PasswordHasher, never, never>
Since v0.1.0