Skip to main content
Version: 0.14.0 (Latest)

🚀 Authentication features

Authentication features are SDK composers, not Express middleware; authService mounts the Authentication features and additional Invitation/OAuth features with the required stores and drivers.

Inventory

FeatureComposed schema(s)Composed route(s)Purpose
loginWithCredentialsFeatureloginWithCredentialsSchemaloginWithCredentialsRouteSign in with credentials.
logoutFeatureMode-selected logoutCookieSchema or logoutBearerSchemalogoutRouteEnd a session.
resendMfaCodeFeatureresendMfaCodeSchemaresendMfaCodeRouteReplace an MFA challenge.
verifyMfaCodeFeatureverifyMfaCodeSchemaverifyMfaCodeRouteComplete MFA.
loginWithOnetimeTokenFeatureloginWithOnetimeTokenSchemaloginWithOnetimeTokenRouteComplete passwordless login.
registerCredentialsFeatureregisterCredentialsSchemaregisterCredentialsRouteRegister credentials.
emailVerificationFeaturesendVerificationEmailSchemasendVerificationEmailRouteSend an email-verification token.
confirmEmailFeatureconfirmEmailSchemaconfirmEmailRouteConfirm an email token.
changeEmailFeaturechangeEmailSchemachangeEmailRouteStart email change.
checkTokenFeaturecheckTokenSchemacheckTokenRouteInspect a token.
confirmNewEmailFeatureconfirmNewEmailSchemaconfirmNewEmailRouteConfirm changed email.
sendResetPasswordLinkEmailFeaturesendResetPasswordLinkEmailSchemasendResetPasswordLinkEmailRouteSend reset email.
completePasswordResetFeaturecompletePasswordResetSchemacompletePasswordResetRouteReset password.
changePasswordFeaturechangePasswordSchemachangePasswordRouteChange password.
deactivateFeaturedeactivateSchemadeactivateRouteDeactivate identity.
activateFeatureactivateSchemaactivateRouteActivate identity.
refreshTokenFeatureMode-selected refreshTokenCookieSchema or refreshTokenBearerSchemarefreshTokenRouteRotate tokens.
deleteRefreshTokensFeaturedeleteRefreshTokensSchemadeleteRefreshTokensRouteRevoke identity refresh tokens.

Details

Each feature is mounted by authService. The source definitions below show the exact schema-to-route composition.

loginWithCredentialsFeature

Implementation

This feature composes the schema and route linked in its inventory row; it is mounted by authService or a compatible custom service context.

View complete source
export const loginWithCredentialsFeature = compose(loginWithCredentialsSchema, loginWithCredentialsRoute);

logoutFeature

Implementation

This feature composes the schema and route linked in its inventory row; it is mounted by authService or a compatible custom service context.

Selects the cookie schema only when configuration.authMode is cookie mode.

View complete source
export const logoutFeature = compose(
ifElse(match(isCookieMode, ['configuration', 'authMode']), logoutCookieSchema, logoutBearerSchema),
logoutRoute
);

resendMfaCodeFeature

Implementation

This feature composes the schema and route linked in its inventory row; it is mounted by authService or a compatible custom service context.

View complete source
export const resendMfaCodeFeature = compose(resendMfaCodeSchema, resendMfaCodeRoute);

verifyMfaCodeFeature

Implementation

This feature composes the schema and route linked in its inventory row; it is mounted by authService or a compatible custom service context.

View complete source
export const verifyMfaCodeFeature = compose(verifyMfaCodeSchema, verifyMfaCodeRoute);

loginWithOnetimeTokenFeature

Implementation

This feature composes the schema and route linked in its inventory row; it is mounted by authService or a compatible custom service context.

View complete source
export const loginWithOnetimeTokenFeature = compose(loginWithOnetimeTokenSchema, loginWithOnetimeTokenRoute);

registerCredentialsFeature

Implementation

This feature composes the schema and route linked in its inventory row; it is mounted by authService or a compatible custom service context.

View complete source
export const registerCredentialsFeature = compose(registerCredentialsSchema, registerCredentialsRoute);

emailVerificationFeature

Implementation

This feature composes the schema and route linked in its inventory row; it is mounted by authService or a compatible custom service context.

View complete source
export const emailVerificationFeature = compose(sendVerificationEmailSchema, sendVerificationEmailRoute);

confirmEmailFeature

Implementation

This feature composes the schema and route linked in its inventory row; it is mounted by authService or a compatible custom service context.

View complete source
export const confirmEmailFeature = compose(confirmEmailSchema, confirmEmailRoute);

changeEmailFeature

Implementation

This feature composes the schema and route linked in its inventory row; it is mounted by authService or a compatible custom service context.

View complete source
export const changeEmailFeature = compose(changeEmailSchema, changeEmailRoute);

checkTokenFeature

Implementation

This feature composes the schema and route linked in its inventory row; it is mounted by authService or a compatible custom service context.

View complete source
export const checkTokenFeature = compose(checkTokenSchema, checkTokenRoute);

confirmNewEmailFeature

Implementation

This feature composes the schema and route linked in its inventory row; it is mounted by authService or a compatible custom service context.

View complete source
export const confirmNewEmailFeature = compose(confirmNewEmailSchema, confirmNewEmailRoute);

sendResetPasswordLinkEmailFeature

Implementation

This feature composes the schema and route linked in its inventory row; it is mounted by authService or a compatible custom service context.

View complete source
export const sendResetPasswordLinkEmailFeature = compose(sendResetPasswordLinkEmailSchema, sendResetPasswordLinkEmailRoute);

completePasswordResetFeature

Implementation

This feature composes the schema and route linked in its inventory row; it is mounted by authService or a compatible custom service context.

View complete source
export const completePasswordResetFeature = compose(completePasswordResetSchema, completePasswordResetRoute);

changePasswordFeature

Implementation

This feature composes the schema and route linked in its inventory row; it is mounted by authService or a compatible custom service context.

View complete source
export const changePasswordFeature = compose(changePasswordSchema, changePasswordRoute);

deactivateFeature

Implementation

This feature composes the schema and route linked in its inventory row; it is mounted by authService or a compatible custom service context.

View complete source
export const deactivateFeature = compose(deactivateSchema, deactivateRoute);

activateFeature

Implementation

This feature composes the schema and route linked in its inventory row; it is mounted by authService or a compatible custom service context.

View complete source
export const activateFeature = compose(activateSchema, activateRoute);

refreshTokenFeature

Implementation

This feature composes the schema and route linked in its inventory row; it is mounted by authService or a compatible custom service context.

Selects the cookie schema only when configuration.authMode is cookie mode.

View complete source
export const refreshTokenFeature = compose(
ifElse(match(isCookieMode, ['configuration', 'authMode']), refreshTokenCookieSchema, refreshTokenBearerSchema),
refreshTokenRoute
);

deleteRefreshTokensFeature

Implementation

This feature composes the schema and route linked in its inventory row; it is mounted by authService or a compatible custom service context.

View complete source
export const deleteRefreshTokensFeature = compose(deleteRefreshTokensSchema, deleteRefreshTokensRoute);