Skip to main content

Function: assertPasswordAdapter()

function assertPasswordAdapter(adapter): asserts adapter is PasswordAdapter

Validates that a supplied Auth.js adapter implements password helper methods.

Parameters​

ParameterTypeDescription
adapteranyAdapter instance provided by the user or plugin configuration.

Returns​

asserts adapter is PasswordAdapter

Throws​

When required password helper functions are missing.

Example​

assertPasswordAdapter(createFlashcoreAdapter({ secret }))