Zebflow Docs
crypto.password.verify
Zebflow Docs

crypto.password.verify

Check the password in --from against the stored --hash (argon2 or bcrypt, read from the hash)

crypto.password.verify --from TEXT --hash TEXT → password

Check the password in --from against the stored --hash (argon2 or bcrypt, read from the hash). A match answers password: { valid: true } on the true pin, a mismatch { valid: false } on false; the rest of the payload is kept. An empty --from or --hash — a login whose lookup found no user — is refused and goes to :error, never to true.

Flags

  • --from (required): The password to check. Usually a {{ }} expression.
  • --hash (required): The stored hash (argon2 or bcrypt).

Examples

Check a password at login

| crypto.password.verify --from "{{ $trigger.body.password }}" --hash "{{ input.query.rows[0]?.password_hash }}"

Fires true or false; wire false to a 401. No user means an empty hash, which goes to :error.

It answers:

json
{  "query": {    "rows": [      {        "id": 7,        "password_hash": "$argon2id$…"      }    ]  },  "password": {    "valid": true  }}